2016-03-20 171 views
12

所以,我一直有这个问题一段时间了。通常,当我刚刚尝试打开我的任何项目,我得到以下错误:Visual Studio 2015社区 - 'Visual C++项目系统包'错误

--------------------------- 
Microsoft Visual Studio 
--------------------------- 
The 'Visual C++ Project System Package' package did not load correctly. 



The problem may have been caused by a configuration change or by the 
installation of another extension. You can get more information by examining the 
file 'C:\Users\Q009\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'. 



Restarting Visual Studio could help resolve this issue. 



Continue to show this error message? 

打开活动日志记录了以下错误:

SetSite failed for package [Visual C++ Project System Package][Object reference not set to an instance of an object.]:{ at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.get_ProjectService() at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.Initialize(IntPtr instResources, Object sp, Object browser, IVCBuildPackageInternal bldPkg)} 

为了“解决”这个,我只是去到AppData/Local/Microsoft并删除VisualStudio和VSCommon文件夹。这解决了一段时间,让我继续工作在我的项目上。直到问题随机决定再次回来。

再次澄清情况。这不是迁移问题,也不是新安装的软件包的问题。我已经安装了一段时间了,这些项目是使用这个Visual Studio实例创建的。

+0

作为变通的解决方案,不能你只需要改变你的IDE? – Joel

+4

关闭IDE后,重新启动它,执行rmdir/q/s%LOCALAPPDATA%\ Microsoft \ VisualStudio \ 14.0 \ ComponentModelCache'。我有一个解决方案的相同问题,该解决方案使用一些(2)使用v10工具链编译的VS2010项目;该解决方案实际上拥有80多个项目,其中两个转换为vs2015。无论如何,它是一个PITA和MS已经知道它,但它继续困扰。 – WhozCraig

+0

是否与删除整个VisualStudio文件夹(与VSCommon一起)不同? – ImQ009

回答

14

我偶尔会得到相同的错误,而不仅仅是C++项目。该解决方案不尽相同,但大多数时候它删去ComponentModelCache下的文件进行,如通过WhozCraig的评论所说:

rmdir /q /s %LOCALAPPDATA%\Microsoft\VisualStudio\14.0\ComponentModelCache 
+2

谢谢!这固定在Visual Studio 2017 –

+1

同样的问题为我工作,谢谢! – ifree

+1

您保存我的vcproj。你是男人!在VS2017的情况下,您应该删除VS2017的组件缓存(文件夹15.0_3734c5e5)。 – pnp0a03

相关问题