Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
373 views
in Technique[技术] by (71.8m points)

c# - Razor syntax highlighting not working in VS 2012 with MVC 5

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 here

I also changed the web.config(s) - see "upgrading from MVC4 to MVC5"

Everything (build, run web app, even intellisense) works perfectly except the syntax highlighting of Razor/C# code in views.

I also tried it with an MVC 5 project created in VS 2013. Same result. So I assume VS 2012 doesn't "understand" the new assemblies?!

Any known workaround or ideas to get highlighting back?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Microsoft released a new version of ASP.NET Web Tools for VS 2012. After installing syntax highlighting is back again.

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

Installing VS 2012 Update 4 was not enough.

A set of offline installers is available. The offline installers are easier to use than the Web Platform Tools invoker (WebNode11Pack.exe @ ~114KB):

If you want an offline installer then please goto http://www.microsoft.com/en-us/download/details.aspx?id=41532

  • AspNetWebTools2013_1Setup.exe @ ~39MB
  • WebToolsExtensionsVS.msi (for Visual Studio 2012 standard edition[s]) @ ~21MB
  • WebToolsExtensionsVWD.msi (for Visual Studio 2012 free "Web" edition[s]) @ ~21MB

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...