Razor intellisense not working in VS 2015

后端 未结 14 1340
南笙
南笙 2020-12-03 05:07

When I load up my VS2013 projects in 2015, all my razor views are filled with red squiggly underlines.

@model, @Scripts @url, @Html.Partial, lambda expressions

相关标签:
14条回答
  • 2020-12-03 05:20

    Here's what FINALLY worked for me: Start -> Run -> (Or Windows Key + R) Then type "devenv.exe /resetuserdata" (no quotes of course)

    I did not have to delete the .vs file, as some others had experienced.

    See also: Visual Studio 2015 Broken Razor Intellisense

    0 讨论(0)
  • 2020-12-03 05:20

    I had same issue and none of these answers worked. What I finally saw was, my Views web.config file was referencing MVC 4, and my main web.config was referencing MVC 5. So I could compile fine but intellisense wasn't working. MVC 4 isn't supported in VS2015. Why my web.config files were different I don't know. When I updated MVC in VS2012 months ago it must not have updated that config file.

    0 讨论(0)
  • 2020-12-03 05:21

    You don't to update anything.
    Just delete component cache from this folder C:\users\xxx\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache And ot will work fine . Try it

    0 讨论(0)
  • 2020-12-03 05:25

    I've upgraded to mvc5 and so forth to razer 3. It solved my issue.

    I followed this instructions :

    http://www.asp.net/mvc/overview/releases/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-21

    0 讨论(0)
  • 2020-12-03 05:28

    None of these solutions fixed it for me. What worked was ensuring my webpages version was up to date. So

    <add key="webpages:Version" value="3.0.0.0" />
    

    in the web.config, instead of version 2.0.0.0

    And then closing and reopening visual studio with the same solution.

    0 讨论(0)
  • 2020-12-03 05:32

    I know that this topic is out of date, but I've just overcome the same problem and my resolution is not related to any one of the listed here.

    The issue is that in my project properties the parameter "Output path" (Build->Output) was a folder different from just "bin\". After changing it to bin\, reopening the Studio and rebuilding my project, everything worked out!

    Hopefully, it might help someone.

    0 讨论(0)
提交回复
热议问题