Visual Studio does not recognize the @model directive

I'm having trouble getting Visual Studio to recognize the @model directive in MVC3. As a result, I do not get Intellisense help. For example, I just loaded a standard MVC3 project in Visual Studio, and it shows all kinds of errors in LogOn.cshtml, because it cannot understand what a view model is. However, if I run the application, everything works fine. So I think this is more annoying than anything else.

+3
source share
1 answer

If you installed the ASP.NET MVC 3 Tools update, make sure you install the version webpagesin your web.config file:

<appSettings>
    <add key="webpages:Version" value="1.0.0.0"/>
    ...
</appSettings>

, Intellisense .


UPDATE:

ASP.NET MVC 3 Tools Update .

+2

All Articles