运行所选代码生成器时发生错误:“对象引用未设置为对象的实例."错误? [英] There was an error running the selected code generator: 'Object reference not set to an instance of an object.' Error?

查看:305
本文介绍了运行所选代码生成器时发生错误:“对象引用未设置为对象的实例."错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了所有解决方案,例如修复VS 2013,但没有用. 当您通过右键单击Controller文件夹并添加控制器来创建控制器时,然后右键单击新创建的控制器的Action并选择Add View,当我尝试创建视图时,它就会发生.它不是一个新项目,而是一个现有项目.

I have tried all the solution like repairing the VS 2013 but no use. when you create a controller by right clicking on the Controller folder and you add the controller, then you right click in the Action of the newly created controller and select Add View, it happens right then, when I try to create a view. Its not a new project, its an existing project.

推荐答案

我在VS2017上遇到了这个问题,并通过执行以下操作解决了这个问题:
转到C:\Users\username\AppData\Local\Microsoft\VisualStudio\15.0_7fca0c70,您将看到一个名为ComponentModelCache的文件夹,它像_ComponentModelCache一样重命名,否则Visual Studio将再次创建此文件夹.
在VisualStudio文件夹名称 15.0_7fca0c70 下要注意的一件事可能有所不同,这取决于您的VS版本.现在您可以开始了.希望对别人有帮助.

I had this issue on my VS2017 and i solved it by doing this:
Go to C:\Users\username\AppData\Local\Microsoft\VisualStudio\15.0_7fca0c70 and you will see a folder named ComponentModelCache just renamed it like _ComponentModelCache or anything else,visual studio will create this folder again.
One thing to notice under VisualStudio folder name 15.0_7fca0c70 can be differenct it depends on your VS version. Now you are good to Go. Hope it helps somebody.

这篇关于运行所选代码生成器时发生错误:“对象引用未设置为对象的实例."错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆