Visual Studio 2012 asp net mvc 3 project razor vie

2019-02-14 10:56发布

问题:

I have problem with intellisense in my asp net mvc 3 project in new visual studio 2012 RC.

If I open VS2010 SP1 asp net mvc project in VS2012, cshtml view like this one :

@model Intranet.Web.ViewModels.Login.LoginVM           
@{
    Model.  // dynamic expression - This operation will be resolved at runtime
}

My configuration : Windows 8 x86(x64 fail too), VS 2012 and 2010SP1 installed.

So, is this bug?

Thanks

回答1:

Add <add key="webpages:Version" value="1.0" /> to <appSettings> in Web.config.

Otherwise, VS2012 will load Razor 2.0 in the editor, and the MVC config settings will not be applied.



回答2:

You will have to restart VS 2012 before the change takes effect.



回答3:

I tried this solution when I had problem, as well as the one where you modify TExt Editor -> formating -> client tag but neither helped in my case. I started the installer once again after some time and hit the upgrade button. For some reason some of the components were not installed succesfully early on. Afterwards everything started working correctly so check that too :).