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. The intellisense in my razor views are not working. Is there any fix for this?
相关问题
- MVC-Routing,Why i can not ignore defaults,The matc
- parameters in routing do not work MVC 3
- There is no ViewData item with the key 'taskTy
- TextBoxFor decimal
- Resharper 7 on VS2012 ignores assembly redirect in
相关文章
- How to get a list of connected clients on SignalR
- Visual Studio Hangs on Loading UI Library
- How do you redirect to the calling page in ASP.NET
- Change color of bars depending on value in Highcha
- The program '[4432] iisexpress.exe' has ex
- ASP.Net MVC 4 Bundles
- How to get server path of physical path ?
- Cannot implicitly convert Web.Http.Results.JsonRes
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.
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.
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.
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)