asp.net - 在 Visual Studio 2013 中打开 cshtml 文件时未将对象引用设置为对象的实例

标签 asp.net asp.net-mvc visual-studio visual-studio-2013

当我尝试在 Visual Studio 2013 中打开 .cshtml 文件时,出现此错误:

enter image description here

Object reference not set to an instance of an object

我已经尝试了给出的解决方案 here但它没有用。
这是我在 web.config 中的 appsettings 部分:
<appSettings>
   <add key="Port" value="25" />
   <add key="webpages:Version" value="3.0.0.0" />
   <add key="webpages:Enabled" value="false" />
   <add key="ClientValidationEnabled" value="true" />
   <add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>

我不认为问题出在这个特定的项目上,因为我所有的其他 MVC 项目都有同样的问题。

最佳答案

我在 Visual Studio 2015 中遇到了完全相同的问题。

我通过删除 %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache 中的所有文件解决了它

(我认为 14.0 文件夹因安装的 VS 版本而异。

关于asp.net - 在 Visual Studio 2013 中打开 cshtml 文件时未将对象引用设置为对象的实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29959210/

相关文章:

c# - 我应该将站点的 ASP.NET Identity 数据库与站点的 "other data"数据库分开吗?

c# - 在 C# 中访问类文件中的母版页

asp.net-mvc - 在 ASP.NET MVC 中覆盖 `HandleErrorAttribute`

visual-studio - 如何在visual studio 2015cordova项目中更新cordova-ios版本?

asp.net - 如何: overload/overwrite default CSS for asp:label tag and make it universal in visual studio 2005?

c# - 使用 WriteAllLines 追加到文本文件

jquery - jqGrid内联编辑功能

asp.net-mvc - 您是否使用任何自定义 ASP.NET MVC HtmlHelper 扩展?

c# - 可访问性不一致 : field type 'System. Collections.Generic.Dictionary<> 的可访问性低于其他字段

visual-studio - ##[警告]未找到 Visual Studio 版本 '14.0'。回退到版本 '15.0'