Visual Studio 2012 asp net mvc 3 project razor view

烈酒焚心 提交于 2019-12-19 03:44:09

问题


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 :).



来源:https://stackoverflow.com/questions/10988328/visual-studio-2012-asp-net-mvc-3-project-razor-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!