c# - Visual Studio 无法打开 cshtml 文件

标签 c# asp.net-mvc visual-studio-2015 nullreferenceexception

我有一个问题,我无法解决。我无法打开 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/

相关文章:

c# - 如何在 C# 中限制文件对话框文件名中的特殊字符?

c# - HTTP 错误 502.5 - 从 Visual Studio 运行应用程序时进程失败

c# - 如何在 Visual Studio 2015 中禁用 namespace 缩写?

android - Visual Studio 不显示已安装的 Android api 级别

C# 事件分发

c# - x64 系统上的 x86 应用程序使用哪个 ngen?

c# - RavenDb 空间查询

c# - 如何扩展同名方法并被调用?

javascript - 从 JQuery Ajax 处理 FileResult

mysql - ASP.NET 配置抛出 "Could not load file or assembly ' MySql.Web,版本 = 6.3.2.0,...“尝试添加新用户时