Razor syntax highlighting not working in VS 2012 with MVC 5

后端 未结 7 1597
陌清茗
陌清茗 2020-12-03 02:29

I\'m playing around with MVC 5 RC 1 in Visual Studio 2013 RC. Works very well.

Now I upgraded an existing MVC 4 project in VS 2012 to MVC 5 the same way as described

7条回答
  •  感动是毒
    2020-12-03 02:53

    I am currently using a workaround to get the IntelliSense working in VS2012 (I assume that this would not work properly a) if I was using VS2013 for the same project; b) if I tried using Razor 3 features):

    Change the web.config to use old webpages version:

    
    

    To make sure that this does not impact the production in any way I added a web.config transformation:

    
    

    Unfortunately this workaround has issues (that I have noticed so far):

    • Extension methods (like Html.RenderPartial() are not recognized and show up as error in the designer).

提交回复
热议问题