Search code examples
asp.net-mvcvisual-studiorazorasp.net-mvc-5

'Personal' is a type, which is not valid in the given context


I just created a new MVC Project and created an empty view. I wrote my first line of code while trying to declare the Model for the view which looks like following:

 @model Personal;

Where personal is a Model which actually exists. However, it is continuously showing me following error:

'Personal' is a type, which is not valid in the given context

I have no idea why something so simple can fail. I wish I could post more code but seriously there is nothing more to it, and I'm not sure why it is failing. I have browsed through some of the SO posts, but not one is having the same error at such a trivial location.

Any suggestions?


Solution

  • @model <namespace>.Personal
    

    IMPORTANT : Remove the semi-colon from the end of your model declaration.