tgjones / HlslTools

A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files
http://timjones.io/blog/archive/2016/04/25/hlsl-tools-for-visual-studio-v1.0-released
Other
562 stars 97 forks source link

Microsoft.VisualStudio.Composition.CompositionFailedException #124

Closed tgjones closed 5 years ago

tgjones commented 6 years ago

Logged by @stef-levesque:

I'm getting an exception in VS 2015 v14.0.25431.01 Update 3, caused by HLSL Tools for Visual Studio 1.1.272.

Seems something goes wrong when initializing ShaderTools.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.ToolTipProvider

There is no active HLSL files as active document.

Thanks for extension, it is much appreciated :)

  <entry>
    <record>653</record>
    <time>2018/03/27 16:18:42.937</time>
    <type>Error</type>
    <source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>
    <description>A MEF Component threw an exception at runtime: Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part &quot;ShaderTools.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.ToolTipProvider&quot;. ---&gt; System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A;   at ShaderTools.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.ToolTipProvider..ctor(ClassificationTypeMap typeMap)&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.&lt;&gt;c__DisplayClass15_0.&lt;GetExportedValueHelper&gt;b__0()</description>
  </entry>
  <entry>
    <record>654</record>
    <time>2018/03/27 16:18:42.965</time>
    <type>Error</type>
    <source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>
    <description>A MEF Component threw an exception at runtime: Microsoft.VisualStudio.Composition.CompositionFailedException: Import &quot;ab.a&quot; could not be satisfied. ---&gt; Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part &quot;ShaderTools.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.ToolTipProvider&quot;. ---&gt; System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A;   at ShaderTools.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.ToolTipProvider..ctor(ClassificationTypeMap typeMap)&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.&lt;&gt;c__DisplayClass15_0.&lt;GetExportedValueHelper&gt;b__0()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.&lt;&gt;c__DisplayClass15_0.&lt;GetExportedValueHelper&gt;b__0()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func`3 lazyFactory)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.SatisfyImports()&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.SatisfyImports()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.SatisfyImmediateImports()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.&lt;&gt;c__DisplayClass15_0.&lt;GetExportedValueHelper&gt;b__0()</description>
  </entry>
  <entry>
    <record>655</record>
    <time>2018/03/27 16:18:42.973</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>Microsoft.VisualStudio.Composition.CompositionFailedException: Import &quot;ab.a&quot; could not be satisfied. ---&gt; Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part &quot;ShaderTools.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.ToolTipProvider&quot;. ---&gt; System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A;   at ShaderTools.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation.ToolTipProvider..ctor(ClassificationTypeMap typeMap)&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.&lt;&gt;c__DisplayClass15_0.&lt;GetExportedValueHelper&gt;b__0()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.&lt;&gt;c__DisplayClass15_0.&lt;GetExportedValueHelper&gt;b__0()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func`3 lazyFactory)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.SatisfyImports()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.SatisfyImports()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.SatisfyImmediateImports()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.&lt;&gt;c__DisplayClass15_0.&lt;GetExportedValueHelper&gt;b__0()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.DelegateServices.&lt;&gt;c__DisplayClass2_0`1.&lt;As&gt;b__0()&#x000D;&#x000A;   at System.Lazy`1.CreateValue()&#x000D;&#x000A;   at System.Lazy`1.LazyInitValue()&#x000D;&#x000A;   at System.Lazy`1.get_Value()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)</description>
  </entry>
tgjones commented 5 years ago

Looks like this is the same issue: https://twitter.com/SebAaltonen/status/1059094931665502209

tgjones commented 5 years ago

@stef-levesque please could you try out this version?

http://vsixgallery.com/extensions/7def6c01-a05e-42e6-953d-3fdea1891737/HLSL%20Tools%20for%20Visual%20Studio%20v1.1.275.vsix

I haven't been able to repro the exception, but I've done a speculative fix that may help.

stef-levesque commented 5 years ago

Done, I'll let you know if I repro the crash

stef-levesque commented 5 years ago

I'm still seeing VS2017 crashes with the following message on reboot: image

Although I don't see any error in the ActivityLog.xml, here are the last records

  <entry>
    <record>998</record>
    <time>2018/11/06 18:14:33.958</time>
    <type>Information</type>
    <source>MruList</source>
    <description>Entering AddItem. Persistence data for item: D:\Path\SomeFile.hlsl|00000000-0000-0000-0000-000000000000|0,0</description>
  </entry>
  <entry>
    <record>999</record>
    <time>2018/11/06 18:14:33.958</time>
    <type>Information</type>
    <source>MruList</source>
    <description>Entering TryPromoteItem</description>
  </entry>
  <entry>
    <record>1000</record>
    <time>2018/11/06 18:14:33.958</time>
    <type>Information</type>
    <source>MruList</source>
    <description>Did not find item to promote</description>
  </entry>
  <entry>
    <record>1001</record>
    <time>2018/11/06 18:14:33.958</time>
    <type>Information</type>
    <source>CodeContainerTracing</source>
    <description>Entering MruItemsStoreServiceDecorator.AddMRUItem. Item category: 335041a8-b61a-4e9f-b0fe-d42dfa193855, lpszItem: D:\Path\SomeFile.hlsl|{00000000-0000-0000-0000-000000000000}|0,0|False</description>
  </entry>
tgjones commented 5 years ago

@stef-levesque are you still getting a crash with the latest version here? http://vsixgallery.com/extension/7def6c01-a05e-42e6-953d-3fdea1891737/

Please re-open if you are.