pvs-studio

Error on startup when not having c++ installed


I'm seeing this error in the activity log when starting up VS 15.3.1. It seems to be related to PVS studio, as it goes away when I disable the extension.

I'm only using C#, so I don't have any c++ modules installed. After clicking OK to the message, I don't experience any other anomaly.

<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: &apos;Microsoft.VisualStudio.Project.VisualC.VCProjectEngine&apos; Description: No platforms have been found on this installation.&#x000D;&#x000A;System.Runtime.InteropServices.COMException (0x8005050A): No platforms have been found on this installation.&#x000D;&#x000A;   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.&lt;ReadInstalledPlatformsAsync&gt;d__260.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.&lt;&gt;c__DisplayClass55_0.&lt;&lt;Initialize&gt;b__0&gt;d.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.&lt;&gt;c__DisplayClass7_0.&lt;&lt;Invoke&gt;b__0&gt;d.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;   at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()&#x000D;&#x000A;   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.Invoke(Func`1 method)&#x000D;&#x000A;   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>

I tried disabling all other third party extensions and restarted VS with the following windows open at startup:

Then enabled PVS and restarted VS: I got the error message

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: &apos;Microsoft.VisualStudio.Project.VisualC.VCProjectEngine&apos; Description: No platforms have been found on this installation.&#x000D;&#x000A;System.Runtime.InteropServices.COMException (0x8005050A): No platforms have been found on this installation.&#x000D;&#x000A;   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.&lt;ReadInstalledPlatformsAsync&gt;d__260.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectEngineShim.&lt;&gt;c__DisplayClass55_0.&lt;&lt;Initialize&gt;b__0&gt;d.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.&lt;&gt;c__DisplayClass7_0.&lt;&lt;Invoke&gt;b__0&gt;d.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;   at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()&#x000D;&#x000A;   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.Invoke(Func`1 method)&#x000D;&#x000A;   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>

I then deleted the component cache folder: I still got the error.

Cleaned using ClearMEFComponentCache. Restarted PVS, and now I can't reproduce.

Other Info: I have upgraded to VS 15.3.2


Solution

  • Unfortunately, we are currently unable to reproduce the issue. Or, to be more precise, we are unable to reproduce it the way it probably occurs in your case. We were able to cause the failure of Visual C++ IDE packages by specifying the incorrect value for the MSBUILD_EXE_PATH environment variable for the devenv.exe process, but your case is most likely different one.

    Could you please elaborate more on what happens to Visual Studio when you launch it with the errors in the activity log you've provided - does the IDE crash? Do some of its components not load correctly? If there are no issues in the operation of the IDE, you can ignore the warnings in the log. If there are issues, please try deleting the 'ComponentModelCache' folder in the %UserProfile%\AppData\Local\Microsoft\VisualStudio\<Visual Studio Version> directory.