I\'m playing around with MVC 5 RC 1 in Visual Studio 2013 RC. Works very well.
Now I upgraded an existing MVC 4 project in VS 2012 to MVC 5 the same way as described
I got this answer from Microsoft developer:
MVC 5/Razor 3 tooling support for VS 2012 has not shipped yet. We hope to ship this support in Mid November.
So the accepted answer is true for now but we can plan to soon have this support in VS2012 as well.
This answer claims that VS2012 can't understand Razor 3, so you (and me) will have to upgrade to VS2013
I am currently using a workaround to get the IntelliSense working in VS2012 (I assume that this would not work properly a) if I was using VS2013 for the same project; b) if I tried using Razor 3 features):
Change the web.config to use old webpages
version:
<add key="webpages:Version" value="2.0.0.0" />
To make sure that this does not impact the production in any way I added a web.config transformation:
<add key="webpages:Version" value="3.0.0.0" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
Unfortunately this workaround has issues (that I have noticed so far):
Html.RenderPartial()
are not recognized and show up as error in the designer).install the "ASP.NET and WebTools 2013.1 for Visual Studio 2012" in the Microsoft Platform Installer
ASP.NET and Web Tools 2013.1 for Visual Studio 2012 has now been released and should resolved the MVC5 intellisense issue with VS 2012.
This release brings a ton of great improvements, and include some fantastic enhancements to ASP.NET MVC 5, Web API 2, Scaffolding and Entity Framework to users of Visual Studio 2012 and Visual Studio 2012 Express for Web.
You can download the update: http://blogs.msdn.com/b/webdev/archive/2013/11/18/announcing-release-of-asp-net-and-web-tools-2013-1-for-visual-studio-2012.aspx
To Moderator: It might be just a download link, but this resolve the issue, it worked for me and it worked for the users that voted this as answer. If you are going to delete it please provide a reason, thanks!
For me, my issue was that I had my build files being output to a directory other than bin
. Once my files we're output to bin
, then my syntax highlighting came back.
One way to fix this is to create a post-build action which copies the files in the project-rooted bin folder (vs a filter outside of the project) to your target directory.
The following article explains: http://www.dennisonpro.info/managing-intellisense-in-razor-views-with-mvc-5-using-custom-builds-in-visual-studio-2013/