高亮杀死了我的剃刀语法在Visual Studio 2010 [英] Highlighting kills my Razor syntax in 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:
- 打开Visual Studio的选项(在
工具
- >选项
), - 选择
字体和颜色
(在左边的树形视图环境下) - 在顶端更改下拉框为
文本编辑器
(如果这是不是值的话), - 选择
剃须刀code
,从显示项目
列表框和 - 更改背景颜色根据自己的喜好,并点击
确定
应用更改。
- Opening Visual Studio Options (Under
Tools
->Options
), - Selecting "
Fonts and Colors
" (Under Environment in the treeview at left) - Changing the dropdown box at top to "
Text Editor
" (if that isn't the value already), - Choosing "
Razor Code
" from the "Display Items
" listbox, and - 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屋!