MVC Razor view Intellisense broken in VS 2013/2015/2017

后端 未结 22 2322
失恋的感觉
失恋的感觉 2020-11-27 16:52

I have an existing project written in VS2010 which when loaded in VS2010 works perfectly.

When I load this same project in VS2013 the MVC Razor views contain lots of

22条回答
  •  清歌不尽
    2020-11-27 17:42

    I have recently solved this problem myself. I upgraded from MVC4 to MVC5 (specifically 5.1). Upgrading to a newer version of MVC caused this havoc and I spent hours trying to solve it. Minor changes to the Web.Config file fixed the intellisense issue!

    You said the project works in VS2010, but not 2013? See this answer here.

    I recommend upgrading to MVC5. It's not painful and the upgrade should be pretty seamless.

    If you upgrade to MVC5 and you're still not getting intellisense, you need to update the Web.Config file manually as the upgrade may not do this correctly!

    Here's a modified version of your Web.conifg in the /Views folder that should reflect changes for MVC5.

      
    
    
        
            

    If upgrading is not an option, then I'm afraid you will need to continue using VS2010 if you want intellisense support for MVC3. However, I strongly suggest upgrading to MVC5.

提交回复
热议问题