Where can I change the Asp.net MVC 3 Razor syntax highlighting in VS10?

孤者浪人 提交于 2019-11-27 17:17:39

问题


I searched Tools > Options, but where in VS10 can I turn off or change the default highlighting for the new Razor view on the @nuggets in ASP.NET MVC 3?


回答1:


Razor only adds one entry to Fonts & Colors, "Razor Code". That controls the background color given to Razor Code nuggets. The rest of the colors are the same as the C#/VB colors. The "@" character itself and Razor keywords like "model" and "section" use the same color as the ASPX "<%" tag ("HTML Server-Side Script", thanks to another Andrew for digging up the specific entry).

If you'd rather we had separate entries for some of these, please email us and suggest that: razorvs@microsoft.com




回答2:


The syntax highlighting for razor is based on the c#/VB default highlighting. So you'll have to change those settings to see any changes in a cshtml file highlighting. Might be a good feature request...I don't know.




回答3:


In Visual Studio 2015

Tools -> Options -> Environment -> Font and colors

The name of the property is HTML Razor Code Background Change the Item background to the color you like.



来源:https://stackoverflow.com/questions/4696102/where-can-i-change-the-asp-net-mvc-3-razor-syntax-highlighting-in-vs10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!