2016-03-20 172 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

相關問題