Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellisense in mvc4 project not working in vs 2012 professional?

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?

like image 748
marko Avatar asked Sep 22 '12 10:09

marko


People also ask

What is mvc4?

ASP.NET MVC 4 is a framework for building scalable, standards-based web applications using well-established design patterns and the power of the ASP.NET and the . NET framework. This new, fourth version of the framework focuses on making mobile web application development easier.


3 Answers

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.

like image 137
DenNukem Avatar answered Nov 10 '22 17:11

DenNukem


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.

like image 39
Petur Subev Avatar answered Nov 10 '22 15:11

Petur Subev


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)

like image 26
Isaac Llopis Avatar answered Nov 10 '22 16:11

Isaac Llopis