未安装 C++ 时启动时出错
Error on startup when not having c++ installed
我在启动 VS 15.3.1 时在 activity 日志中看到这个错误。
它似乎与 PVS 工作室有关,因为当我禁用扩展程序时它就消失了。
我只使用 C#,所以我没有安装任何 C++ 模块。
对该消息单击“确定”后,我没有遇到任何其他异常情况。
<entry>
<record>243</record>
<time>2017/08/22 05:07:13.222</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [Visual C++ Project System Package]Source: 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine' Description: No platforms have been found on this installation.
System.Runtime.InteropServices.COMException (0x8005050A): No platforms have been found on this installation.
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.<ReadInstalledPlatformsAsync>d__260.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.<>c__DisplayClass55_0.<<Initialize>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.<>c__DisplayClass7_0.<<Invoke>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.Invoke(Func`1 method)
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.Initialize(IntPtr instResources, Object sp, Object browser, IVCBuildPackageInternal bldPkg)</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
<hr>8005050a</hr>
<errorinfo></errorinfo>
</entry>
<entry>
<record>245</record>
<time>2017/08/22 05:07:15.009</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [Visual C++ Project System Package](null)</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
<hr>8005050a</hr>
<errorinfo></errorinfo>
</entry>
<entry>
<record>246</record>
<time>2017/08/22 05:07:15.010</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [Visual C++ Project System Package]</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
<hr>8005050a</hr>
<errorinfo></errorinfo>
</entry>
我尝试禁用所有其他第三方扩展并重新启动 VS,并在启动时打开以下 windows:
- C# 交互
- 错误列表
- 任务列表
- 命令Window
- 输出
- 测试资源管理器
- 解决方案资源管理器
- 团队资源管理器
- 起始页
然后启用 PVS 并重新启动 VS:我收到错误消息
The 'Visual C++ Project System Package' did not load correctly.
<entry>
<record>1784</record>
<time>2017/08/24 19:55:34.094</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Begin package load [Visual C++ Project System Package]</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
</entry>
<entry>
<record>1785</record>
<time>2017/08/24 19:55:34.097</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [Visual C++ Project System Package]Source: 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine' Description: No platforms have been found on this installation.
System.Runtime.InteropServices.COMException (0x8005050A): No platforms have been found on this installation.
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.<ReadInstalledPlatformsAsync>d__260.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.<>c__DisplayClass55_0.<<Initialize>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.<>c__DisplayClass7_0.<<Invoke>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.Invoke(Func`1 method)
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.Initialize(IntPtr instResources, Object sp, Object browser, IVCBuildPackageInternal bldPkg)</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
<hr>8005050a</hr>
<errorinfo></errorinfo>
</entry>
<entry>
<record>1786</record>
<time>2017/08/24 19:55:34.100</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [Visual C++ Project System Package](null)</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
<hr>8005050a</hr>
<errorinfo></errorinfo>
</entry>
<entry>
<record>1787</record>
<time>2017/08/24 19:55:34.102</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [Visual C++ Project System Package]</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
<hr>8005050a</hr>
<errorinfo></errorinfo>
</entry>
然后我删除了组件缓存文件夹:
我仍然遇到错误。
已使用 ClearMEFComponentCache 清理。
重启PVS,现在无法重现
其他信息:我已经升级到 VS 15.3.2
- 在运行 ClearMEFComponentCache 之前,我在
%appdata%\Microsoft\VisualStudio
中有几个文件夹,即 14.0
、15.0
和 15.0_aaea4580
,其中 ComponentCache
文件夹所在。
现在我只有 15.0_aaea4580
文件夹。
- VS 在管理员模式下打开。
很遗憾,我们目前无法重现该问题。或者,更准确地说,我们无法按照您的情况可能发生的方式重现它。我们能够通过为 devenv.exe 进程的 MSBUILD_EXE_PATH 环境变量指定不正确的值来导致 Visual C++ IDE 包失败,但你的情况很可能是不同的。
您能否详细说明当您启动 Visual Studio 并在您提供的 activity 日志中出现错误时会发生什么情况 - IDE 会崩溃吗?它的某些组件是否未正确加载?如果IDE运行没有问题,可以忽略日志中的警告。
如果有问题,请尝试删除 %UserProfile%\AppData\Local\Microsoft\VisualStudio\ 目录中的 'ComponentModelCache' 文件夹。
我在启动 VS 15.3.1 时在 activity 日志中看到这个错误。 它似乎与 PVS 工作室有关,因为当我禁用扩展程序时它就消失了。
我只使用 C#,所以我没有安装任何 C++ 模块。 对该消息单击“确定”后,我没有遇到任何其他异常情况。
<entry>
<record>243</record>
<time>2017/08/22 05:07:13.222</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [Visual C++ Project System Package]Source: 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine' Description: No platforms have been found on this installation.
System.Runtime.InteropServices.COMException (0x8005050A): No platforms have been found on this installation.
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.<ReadInstalledPlatformsAsync>d__260.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.<>c__DisplayClass55_0.<<Initialize>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.<>c__DisplayClass7_0.<<Invoke>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.Invoke(Func`1 method)
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.Initialize(IntPtr instResources, Object sp, Object browser, IVCBuildPackageInternal bldPkg)</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
<hr>8005050a</hr>
<errorinfo></errorinfo>
</entry>
<entry>
<record>245</record>
<time>2017/08/22 05:07:15.009</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [Visual C++ Project System Package](null)</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
<hr>8005050a</hr>
<errorinfo></errorinfo>
</entry>
<entry>
<record>246</record>
<time>2017/08/22 05:07:15.010</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [Visual C++ Project System Package]</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
<hr>8005050a</hr>
<errorinfo></errorinfo>
</entry>
我尝试禁用所有其他第三方扩展并重新启动 VS,并在启动时打开以下 windows:
- C# 交互
- 错误列表
- 任务列表
- 命令Window
- 输出
- 测试资源管理器
- 解决方案资源管理器
- 团队资源管理器
- 起始页
然后启用 PVS 并重新启动 VS:我收到错误消息
The 'Visual C++ Project System Package' did not load correctly.
<entry>
<record>1784</record>
<time>2017/08/24 19:55:34.094</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Begin package load [Visual C++ Project System Package]</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
</entry>
<entry>
<record>1785</record>
<time>2017/08/24 19:55:34.097</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [Visual C++ Project System Package]Source: 'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine' Description: No platforms have been found on this installation.
System.Runtime.InteropServices.COMException (0x8005050A): No platforms have been found on this installation.
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.<ReadInstalledPlatformsAsync>d__260.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.<>c__DisplayClass55_0.<<Initialize>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.<>c__DisplayClass7_0.<<Invoke>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.Invoke(Func`1 method)
 at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.Initialize(IntPtr instResources, Object sp, Object browser, IVCBuildPackageInternal bldPkg)</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
<hr>8005050a</hr>
<errorinfo></errorinfo>
</entry>
<entry>
<record>1786</record>
<time>2017/08/24 19:55:34.100</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [Visual C++ Project System Package](null)</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
<hr>8005050a</hr>
<errorinfo></errorinfo>
</entry>
<entry>
<record>1787</record>
<time>2017/08/24 19:55:34.102</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [Visual C++ Project System Package]</description>
<guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
<hr>8005050a</hr>
<errorinfo></errorinfo>
</entry>
然后我删除了组件缓存文件夹: 我仍然遇到错误。
已使用 ClearMEFComponentCache 清理。 重启PVS,现在无法重现
其他信息:我已经升级到 VS 15.3.2
- 在运行 ClearMEFComponentCache 之前,我在
%appdata%\Microsoft\VisualStudio
中有几个文件夹,即14.0
、15.0
和15.0_aaea4580
,其中ComponentCache
文件夹所在。 现在我只有15.0_aaea4580
文件夹。 - VS 在管理员模式下打开。
很遗憾,我们目前无法重现该问题。或者,更准确地说,我们无法按照您的情况可能发生的方式重现它。我们能够通过为 devenv.exe 进程的 MSBUILD_EXE_PATH 环境变量指定不正确的值来导致 Visual C++ IDE 包失败,但你的情况很可能是不同的。
您能否详细说明当您启动 Visual Studio 并在您提供的 activity 日志中出现错误时会发生什么情况 - IDE 会崩溃吗?它的某些组件是否未正确加载?如果IDE运行没有问题,可以忽略日志中的警告。
如果有问题,请尝试删除 %UserProfile%\AppData\Local\Microsoft\VisualStudio\