MVC 5 -> MVC 5.1 Migration. Intellisense issues

做~自己de王妃 提交于 2019-12-30 06:54:34

问题


I just updated my project to MVC 5.1 from MVC 5. The main web.config file got updated automatically, but web.configs under main View and Areas folders weren't changed. I suspect that's why now I lost both intellisense and resharper support for my actions, controllers and areas.

Does anyone know correct web.config content for MVC 5.1 Views? Just replacing 3.0.0.0 to 3.1.0.0 and 5.0.0.0 -> 5.1.0.0 did not solve the issue.

It happens in both Visual Studio 2012 and 2013 Professional.


回答1:


Found a solution from this MS article:

MVC 5.1 Tooling Support and Razor IntelliSense are Still Broken Even After Installing VS2013 Update 1 RC

Known issue:

If a VS2013 user installed “Microsoft ASP.NET and Web Tools 2013.1 for Visual Studio 2013” before they install VS2013 Update 1 RC, they won’t be able to get MVC 5.1 tooling support that comes with VS2013 Update 1 RC.

Symptom:

MVC 5.1 tooling support and Razor IntelliSense are still broken even after installing VS2013 Update 1 RC.

Workaround:

  1. From "Add/Remove Program", uninstall "Microsoft ASP.NET and Web Tools 2013.1 for Visual Studio 2013"
  2. Repair VS2013 RTM
  3. Install VS2013 update 1 RC if you have not yet installed it. If you have already installed this, you don’t need to reinstall or repair it.
  4. From Web PI, reinstall Microsoft ASP.NET and Web Tools 2013.1 for Visual Studio 2013 or repair Azure SDK 2.2.



回答2:


Update NuGet Packages

Steps:

  1. Select TOOLS –> NuGet Package Manager –> Package Manager Console. This opens the Package Manager Console pane.
  2. In command prompt, type Update-Package and press Enter.

This command will update the MVC files and activate the intellisense again.




回答3:


Well if you update to ASP.NET MVC 5.1 RTM without updating Visual Studio 2013, you will not get Visual Studio editor support for syntax highlighting while editing the Razor views. You will need to update Visual Studio 2013 to get this support. So it is not directly connected with IntelliSense or Resharper. But anyway I would try to update VS13 to VS13 Update 1




回答4:


Update NuGet Packages in Package Manager Console.

Verify the current version of System.web.MVC and update it in the Views/Web.config file and also verify the version in Web.config of Root folder.



来源:https://stackoverflow.com/questions/21343714/mvc-5-mvc-5-1-migration-intellisense-issues

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