我有一个问题,我无法解决。我无法打开 Visual Studio c# mvc 项目中的每个 cshtml-File(无论我试过哪个项目)。 我收到以下错误消息(我尝试翻译成英文):
Object reference not set to an instance to an object
Google 说,它可能是一个 NullReferenceExeception。但这与我的代码无关,因为首先我可以成功执行项目,其次每个项目都出现错误(从今天开始)。
最佳答案
我刚遇到同样的问题。正如你所描述的,它只是突然冒出来的。我什至经历了 2 小时的维修。那并没有解决问题。
但是,一位同事建议了此修复。
Visual Studio 2015 not syntax highlighting razor nor Intellisense
I had the same problem, the only fix so far is by resetting all user data (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe /ResetUserData).
现在我可以使用真正的默认编辑,并且再次获得良好的语法高亮显示。
关于c# - Visual Studio 无法打开 cshtml 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34155654/