Razor 语法突出显示在 VS 2012 与 MVC 5 中不起作用 [英] Razor syntax highlighting not working in VS 2012 with MVC 5

查看:22
本文介绍了Razor 语法突出显示在 VS 2012 与 MVC 5 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Visual Studio 2013 RC 中使用 MVC 5 RC 1.效果很好.

I'm playing around with MVC 5 RC 1 in Visual Studio 2013 RC. Works very well.

现在我按照与这里

我还更改了 web.config(s) - 请参阅从升级MVC4 到 MVC5"

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

除了视图中 Razor/C# 代码的语法高亮显示外,一切(构建、运行 Web 应用程序,甚至智能感知)都能完美运行.

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

我还使用在 VS 2013 中创建的 MVC 5 项目进行了尝试.结果相同.所以我认为 VS 2012 不理解"新程序集?!

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?

推荐答案

Microsoft 发布了适用于 VS 2012 的新版本 ASP.NET Web 工具.安装语法高亮后又回来了.

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/annoucing-release-of-asp-net-and-web-tools-2013-1-for-visual-studio-2012.aspx

安装 VS 2012 Update 4 还不够.

Installing VS 2012 Update 4 was not enough.

有一组离线安装程序可用.离线安装程序比 Web 平台工具调用程序 (WebNode11Pack.exe @ ~114KB) 更易于使用:

如果您想要离线安装程序,请转至 http://www.microsoft.com/en-us/download/details.aspx?id=41532

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(适用于 Visual Studio 2012 标准版[s])@~21MB
  • WebToolsExtensionsVWD.msi(适用于 Visual Studio 2012 免费Web"版[s])@~21MB
    • 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
    • 这篇关于Razor 语法突出显示在 VS 2012 与 MVC 5 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆