Intellisense in mvc4 project not working in vs 2012 professional?

前端 未结 4 1645
夕颜
夕颜 2021-01-03 01:41

In my razor views the intellisense is not working. Are there any fixes for this? I\'m using the newly released VS 2012 Professional and building a ASP.NET MVC 4 project. Th

相关标签:
4条回答
  • 2021-01-03 02:13

    I've met the same problem in my working solution. However Intellisense still was working for new mvc4 projects created by VS wizard. When i compared my csproj file with the new csproj file i mentioned that for all referenced mvc assemblies were set options SpecificVersion=true and copy local = true. So i did the same for my project and problem disappeared.

    0 讨论(0)
  • 2021-01-03 02:30

    You might be experiencing issues which are covered in the "Known Issues and Breaking Changes" section when upgrading from MVC3 to MVC4 in this release notes post.

    Follow the instructions in the "Installing ASP.NET MVC 4 breaks ASP.NET MVC 3 RTM applications" section to resolve the issue.

    0 讨论(0)
  • 2021-01-03 02:33

    What helped me was to delete the .csproj.user file. Additionally, I have also deleted a who bunch of other things: packages, .suo file, bin/ and obj/, I also did devenv.exe /setup, and devenv.exe /resetsettings, but what helped, I think, was exactly that - deleting the .csproj.user file.

    0 讨论(0)
  • 2021-01-03 02:34

    I just had the same problem when using RazorGenerator.Mvc on any project. Creating a brand new MVC4 project worked well untill RazorGenerator.Mvc entered into the game. It may well be that the cause is any other.

    For me, checking that MVC4 project is using the latest version of MVC4 with NuGet is what solved it.

    Go to the Package Administrator and search for MVC. You'll find that Microsoft's MVC4 has two available packages, one called "Microsoft ASP.NET MVC 4" and another called "ASP.NET MVC 4", and it happens to be that both have the same version number: 4.0.20710.0

    One of them (the no-Microsoft one) says "Legacy package" but most likely that's the one your projects are using. Uninstall that one with NuGet on all your projects and install the "Microsoft ASP.NET MVC 4" package instead.

    Close and reopen every cshtml view you have in the screen and then reopen some (you may have to wait for a minute or two for highlighting to show up). If in five minutes the syntax highlighting does not show up, close and reopen Visual Studio 2012.

    (Tried with Visual Studio 2012 Premium)

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