简体   繁体   English

创建新项目或打开项目时出现 VS 2015 错误“对象引用未设置到对象的实例”?

[英]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:要尝试修复它,我建议您执行以下操作:

  1. Open the "Develop Command Prompt" in elevated mode (a shortcut should be installed with Visual Studio).在提升模式下打开“开发命令提示符”(应使用 Visual Studio 安装快捷方式)。 If you don't have it in the start menu, open 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\\
  2. Run the command devenv /setup , and wait.运行命令devenv /setup ,然后等待。
  3. Once it's done, try running your Visual Studio again.完成后,再次尝试运行 Visual Studio。

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/361842https://stackoverflow.com/a/37688026/361842复制的答案

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.

相关问题 在vs2015中打开旧项目时的企业库参考错误 - Enterprise Library reference error when opening a legacy project in vs2015 Visual Studio 2015:创建Azure移动应用程序时,“对象引用未设置为对象的实例” - Visual Studio 2015: “Object reference not set to an instance of an object” when creating Azure Mobile App 在vs 2015社区中创建新项目时出错 - Error During creating new project in vs 2015 Community 在VS 2015 Community Edition中创建新的.Net Core项目时出现0x80070002错误 - 0x80070002 Error when creating a new .Net Core project in VS 2015 Community Edition 在VS 2015中创建Xamarin.Android项目时出错 - Error when creating Xamarin.Android project in VS 2015 在 VS2015 中从包管理器控制台安装 Entityframework 7 时出现 Nuget 错误“对象引用未设置为对象的实例” - Nuget error “Object reference not set to an instance of an object” while installing Entityframework 7 from Package Manager Console in VS2015 NuGet包管理器不在VS2015上搜索或安装 - 对象引用未设置为对象的实例 - NuGet Package Manager not searching or installing on VS2015 - Object reference not set to an instance of an object 错误“未为项目设置OutputPath属性” VS 2015 - Error “The OutputPath property is not set for project” VS 2015 Visual Studio 2015在“我的工作”选项卡上显示“对象引用未设置为对象的实例”错误 - Visual Studio 2015 shows “Object reference not set to an instance of an object” error on “My Work” tab 在VS2015中创建新项目时,用户凭据验证失败 - User credential verification failed when creating new project in VS2015
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM