Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'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?

like image 394
Lost Avatar asked Dec 24 '15 04:12

Lost


1 Answers

@model <namespace>.Personal 

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

like image 79
joby-flick Avatar answered Oct 11 '22 17:10

joby-flick