高亮杀死了我的剃刀语法在Visual Studio 2010 [英] Highlighting kills my Razor syntax in Visual Studio 2010

查看:278
本文介绍了高亮杀死了我的剃刀语法在Visual Studio 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的防爆pression 主题>​​的Visual Studio 2010旗舰版在 Windows 7的操作系统。 (注意:其实,我不知道是因为黑暗的主题这个问题)前几天,我决定学习 ASP.NET MVC 4 ,并试图建立一个小型Web应用程序。在Visual Studio中,我遵循了这一指令,并创造了新的asp.net的MVC 4 Web应用程序:文件>新建 - >项目 - > ASP.NET MVC 4 Web应用程序

I'm using Expression theme in Visual Studio 2010 Ultimate on Windows 7 operating system. (Note: Actually, I'm not sure this problem occurs because of the dark theme) A few days ago, I decided to learn ASP.NET MVC 4 and tried to create a small web application. In Visual Studio, I followed this instruction and created a new asp.net mvc 4 web application: File->New->Project->ASP.NET MVC 4 Web Application.

一切都很完美。但是,当我打开 Login.cshtml 文件,我甚至不能看到剃刀语法(如pressions始于 @ ),因为突出。请看下图:

Everything was perfect. But when I opened the Login.cshtml file, I couldn't even see the razor syntax (expressions which started @) because of highlighting. Take a look:

即使我选择所有的文字<大骨节病> CTRL + <大骨节病> A 在Visual Studio中,我几乎看不到的语法。

Even if I select all the text with CTRL + A in Visual Studio, I barely see the syntax.

正因为如此,我甚至不能开始学习asp.net mvc的。我开始寻找在互联网上这种情况的解决方案,但我无法找到任何有用的答案。在Visual Studio中,我看了工具 - &GT;选项 - &GT;字体和颜色选项,但我无法找到任何这种东西。只有这个问题表明,当我在查看我工作(为剃须刀)。有一个在模式控制器或任何其他code文件。

Because of that, I can't even start to learn asp.net mvc. I started to look for a solution for this situation on the internet, but I couldn't find any useful answer. In Visual Studio, I looked the Tools->Option->Font and Colors option, but I couldn't find anything for this either. This problem shows only when I'm working in a View (for the Razor). There is no highlighting problem in Model, Controller or any other code files.

用户ray247要求足够接近我的问题叫<一个问题href=\"http://stackoverflow.com/questions/4696102/where-can-i-change-the-asp-net-mvc-3-razor-syntax-hightlighting-in-vs10\">Where我可以改变的VS10 MVC Asp.net 3剃刀语法hightlighting?,但我仍然无法找到一个解决方案。我不想停止使用我的黑暗的主题。这对我的眼睛真的很不错。

User ray247 asked a question close enough to my question called Where can I change the Asp.net MVC 3 Razor syntax hightlighting in VS10? but I still can't find a solution. I don't want to stop using my dark theme. It's really good for my eyes.

推荐答案

您应该能够通过更改文本背景剃刀code:

You should be able to change the text background for Razor code by:


  1. 打开Visual Studio的选项(在工具 - > 选项),

  2. 选择字体和颜色(在左边的树形视图环境下)

  3. 在顶端更改下拉框为文本编辑器(如果这是不是值的话),

  4. 选择剃须刀code ,从显示项目列表框和

  5. 更改背景颜色根据自己的喜好,并点击确定应用更改。

  1. Opening Visual Studio Options (Under Tools -> Options),
  2. Selecting "Fonts and Colors" (Under Environment in the treeview at left)
  3. Changing the dropdown box at top to "Text Editor" (if that isn't the value already),
  4. Choosing "Razor Code" from the "Display Items" listbox, and
  5. Changing the background color to your liking and clicking "OK" to apply the change.

还有一个控制剃刀code分隔符的背景颜色( @ 前pression和类似的HTML服务器端脚本设置前pressions标志着code块的开始。)

There's also an "HTML Server-Side Script" setting that controls the background color of the Razor code delimiters (the @ expression and similar expressions that mark the beginnings of code blocks.)

HTH,

克莱

HTH,
Clay

这篇关于高亮杀死了我的剃刀语法在Visual Studio 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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