I recently installed vs 2013 professional and opened one of my side project applications in it . The project is an MVC3 application using the razor view engine. I noticed that when editing a view (cshtml ) I wasn't getting access to intellisense that I was used to in 2012. 2 Examples i noticed right away were @Url.Content() and @Viewbag. The code still compiles and runs, just no intellisense. After messing with it a bit i figured i should check the upgrade log and sure enough i found ...
"Intellisense for Razor (CSHTML and VBHTML) files is limited to HTML markup. Please see http://go.microsoft.com/fwlink/?LinkID=317645 for additional information on how to upgrade an MVC 3 project."
The link provided just tells you to upgrade from mvc3 to mvc4. My question is: is that my only option ? In order to use VS2013 on older mvc3 projects am I going to have to upgrade them all or will vs2013 ever support full intellisense on mvc razor files?
You can try Unload the project from solution explorer and Reload it again. See if you can get your intellisense back. It worked for me.
1- From tools select Nuget package manager console 2- download system.web.mvc 3 using this PM> Install-Package Microsoft.AspNet.Mvc -Version 3.0.20105.1
Found this here ...
http://geekswithblogs.net/anirugu/archive/2013/10/16/how-to-migrate-asp.net-mvc-3--mvc4-project-to.aspx
Ended up upgrading the project to MVC 5 ... Created a new project and brought over all the contents of my model, view and controller folders. Also had to update the webconfig to include some packages I had installed in the previous project.
Add these two lines inside each view:
and the intellisense will work again for MVC3 in VS2013