[英]VS 2015 Error “Object reference not set to an instance of an object” when creating a new project or opening a project?
Environment:WIN 10 Pro IDE:Visual Studio 2015 Community环境:WIN 10 Pro IDE:Visual Studio 2015 Community
When I tried to create a project or open projects,the VS would warn that"Object reference not set to an instance of an object".Andreading the System Log,I found this recording:当我尝试创建项目或打开项目时,VS 会警告“对象引用未设置为对象的实例”。安德烈德查看系统日志,我发现了以下记录:
Faulting application name: devenv.exe, version: 14.0.23107.0, timestamp:
0x559b7ead
Faulting Module Name: unknown, Version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0x80131623
Error offset: 0x161c5b8e
Error Process ID: 0x159c
Faulting application start time: 0x01d109944863532a
Faulting application path: D: \ CODESOFT \ Common7 \ IDE \ devenv.exe
Error module path: unknown
Report ID: 71d54c89-2d77-4994-9fac-0d30bd06b3d8
Error package Full name:
Error package relative to the application ID:
Although I spent many times searching in Google or any other websites and trying different ways to solve this question,but now the question is still exists.虽然我花了很多时间在谷歌或任何其他网站上搜索并尝试不同的方法来解决这个问题,但现在问题仍然存在。
There could be several reasons for this: corrupted install, faulting extension and so on.这可能有多种原因:安装损坏、扩展错误等。
Your error message doesn't necessary help, since it doesn't contain any useful diagnostic information, however it suggests your Visual Studio isn't installed in the "default" location (eg Program Files (x86)
).您的错误消息不需要帮助,因为它不包含任何有用的诊断信息,但是它表明您的 Visual Studio 未安装在“默认”位置(例如
Program Files (x86)
)。 It may be that it wasn't installed correctly, or otherwise has corrupt settings.可能是它没有正确安装,或者设置损坏。
To try and repair it, I suggest you do the following:要尝试修复它,我建议您执行以下操作:
cmd.exe
as administrator, and go to where your devenv.exe
file is located (in your case, it looks to be D:\\CODESOFT\\Common7\\IDE\\
)cmd.exe
,然后转到devenv.exe
文件所在的位置(在您的情况下,它看起来是D:\\CODESOFT\\Common7\\IDE\\
)devenv /setup
, and wait.devenv /setup
,然后等待。 If you still have an issue after this, I suggest running a repair installation of Visual Studio.如果在此之后仍有问题,我建议运行 Visual Studio 的修复安装。
I know this is a bit late, but hopefully it will help someone along the way.我知道这有点晚了,但希望它会对一路上的人有所帮助。 You may try resetting your Visual Studio environment.
您可以尝试重置您的 Visual Studio 环境。 This worked for me.
这对我有用。
Run the command devenv /resetuserdata运行命令 devenv /resetuserdata
Thanks to Fka for the answer.感谢 Fka 的回答。 Visual Studio 2015 error "Object reference not set to an instance of an object" after install of ASP.NET and Web Tools 2015 (RC1 Update 1)
安装 ASP.NET 和 Web Tools 2015(RC1 更新 1)后出现 Visual Studio 2015 错误“未将对象引用设置为对象的实例”
Answer copied from https://stackoverflow.com/a/37688026/361842从https://stackoverflow.com/a/37688026/361842复制的答案
Tools
> Clear MEF Component Cache
Tools
> Clear MEF Component Cache
Yes
Yes
File
, New Project
(or whatever had caused you the error before);File
, New Project
(或之前导致错误的任何内容); all should be good.You should check the templates you have installed too, in my case it was the Ionic Templates (which i guess have a bug or something), after making a proyect using ionic template for apache cordova it didn't let me create another proyect, showing the "object reference..." error.您也应该检查您已安装的模板,在我的情况下,它是离子模板(我猜它有一个错误或其他东西),在使用 apache cordova 的离子模板制作一个项目后,它没有让我创建另一个项目,显示“对象引用...”错误。
What i did was uninstall the ionic templates and install them again, but the issue persists, having to uninstall and install ionic templates every time i try to create a proyect.我所做的是卸载离子模板并再次安装它们,但问题仍然存在,每次尝试创建项目时都必须卸载并安装离子模板。 Hope it's helpful for someone.
希望它对某人有帮助。
My situation is that every time when i restart Windows, I can't create new project.我的情况是每次重新启动 Windows 时,我都无法创建新项目。 I'v tried to uninstall several extensions, it worked awhile, but it still cracked after restarting.
我试过卸载几个扩展,它工作了一段时间,但重新启动后它仍然破裂。
The Clear MEF Component Cache doesn't work for me, although I find that it helps. Clear MEF Component Cache对我不起作用,尽管我发现它有帮助。
Delete the contents from the following folders: C:\\Users{user}\\AppData\\Local\\Microsoft\\VisualStudio C:\\Users{user}\\AppData\\Local\\Microsoft\\VSCommon
删除以下文件夹中的内容:C:\\Users{user}\\AppData\\Local\\Microsoft\\VisualStudio C:\\Users{user}\\AppData\\Local\\Microsoft\\VSCommon
https://stackoverflow.com/a/34085345/8282574 `
https://stackoverflow.com/a/34085345/8282574 `
So I use a more simple solution and it works.所以我使用了一个更简单的解决方案并且它有效。
fixVS.bat
rd/s/q %LOCALAPPDATA%\Microsoft\VisualStudio
rd/s/q %LOCALAPPDATA%\Microsoft\VSCommon
The problem is that each time when I want to create a new project, perhaps I still need to run it again and again...问题是每次想新建项目的时候,可能还需要一遍遍的运行...
Tried a lot of different things when I had this issue.当我遇到这个问题时尝试了很多不同的东西。 Only fix for me was updating Visual Studio from Visual Studio Installer.
对我来说唯一的解决方法是从 Visual Studio 安装程序更新 Visual Studio。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.