c# - 运行所选代码生成器时出错 : 'Object reference not set to an instance of an object.' Error?

标签 c# visual-studio-2013 asp.net-mvc-5

enter image description here

我已经尝试了所有解决方案,例如修复 VS 2013,但没有用。 当您通过右键单击 Controller 文件夹创建 Controller 并添加 Controller 时,然后右键单击新创建的 Controller 的操作并选择添加 View ,当我尝试创建 View 时,它就发生了。这不是新项目,而是现有项目。

最佳答案

我在我的 VS2017 上遇到了这个问题,我通过这样做解决了它:
转到 C:\Users\username\AppData\Local\Microsoft\VisualStudio\15.0_7fca0c70,您将看到一个名为 ComponentModelCache 的文件夹,只是将其重命名为 _ComponentModelCache 或其他任何东西,visual studio 将再次创建此文件夹。
在 VisualStudio 文件夹名称 15.0_7fca0c70 下需要注意的一件事可能会有所不同,这取决于您的 VS 版本。现在你可以开始了。希望对某人有所帮助。

关于c# - 运行所选代码生成器时出错 : 'Object reference not set to an instance of an object.' Error?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39127199/

相关文章:

c# - 在通用参数中使用多态性

visual-studio - Visual Studio 警告 : “Some of the properties associated with the solution could not be read”

visual-studio - 从 VS2013 中删除 NuGet 包管理器

c# - Asp.net Space 自动生成为 html Div

c# - Owin Context 每个请求使用一个实例

asp.net-mvc - 如何获取“System.Web.Http,版本=5.2.3.0”?

c# - asp :Button OnClick event 的问题

c# - 使用 Telerik 组件正确部署应用程序

c# 确认每个组合框都选择了唯一的值

wpf - VS2013 : An error occurred while finding the resource dictionary