我有一个相当大的 ASP MVC 项目,我在 Visual Studio 15.4.5 中运行。每当我查看 .cshtml 文件时,Visual Studio 都会错误地突出显示该文件,例如:
我试过的
最佳答案
我在试图解决突出自己的麻烦时发现了这个问题,所以我想我会分享我的发现。显然,这是有意的行为,因为它被称为“Razor Syntax Highlighting”,通过 MSDN 上的 this post 和这里的另一个问题:How do you turn off Razor highlighting in VS 2013? 我能够确定如何在我的机器上关闭它。
引自 MSDN 帖子:
This highlighting is the built in support for Razor syntax highlighting. If you do not like it, you can open your .cshtml files in Visual Studio using the HTML editor
对我有用的更改的屏幕截图:
关于asp.net - Razor 语法高亮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47657942/