© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•11mo ago•
31 replies
morry329#

✅ the type or namespace name 'ListingProjects' does not exist in the namespace models

So I don't understand why my code has been getting this message.
It started when I added a new attribute to my model class in my CRUD app like this

public class ListingProjects_ver2 //I renamed the model class name as well 
{
    
    [System.ComponentModel.DataAnnotations.Key]
    [Required]
    public int? Id { get; set; } // Primary key for DTO
    
    [Required]
    public string? ListingName { get; set; } 

    [Required]
    [NotMapped]
    public IFormFile? ListingImage { get; set; } //this is the attribute I added 
}
public class ListingProjects_ver2 //I renamed the model class name as well 
{
    
    [System.ComponentModel.DataAnnotations.Key]
    [Required]
    public int? Id { get; set; } // Primary key for DTO
    
    [Required]
    public string? ListingName { get; set; } 

    [Required]
    [NotMapped]
    public IFormFile? ListingImage { get; set; } //this is the attribute I added 
}


My CRUD lets me create/delete/read my data out of my db, but only the edit operation fails. It does not save my edits as per screenshot

My debug shows this message
the type or namespace name 'ListingProjects' does not exist in the namespace models (are you missing a reference) 
the type or namespace name 'ListingProjects' does not exist in the namespace models (are you missing a reference) 


Could anyone kindly point me in the direction to resolve this bug?
Screenshot_2025-03-15_alle_21.57.14.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ The type or namespace name 'MAUI' does not exist in the namespace 'Microsoft'
C#CC# / help
4y ago
❔ namespace 'Models' does not exist in the namespace 'BlazorBookGroup'
C#CC# / help
4y ago
The type or namespace name 'Screen' does not exist in the namespace 'System.Windows.Forms'
C#CC# / help
2y ago
The name "___" does not exist in the namespace "clr-namespace:redfish.Controls"
C#CC# / help
5mo ago