pharring/EditorGuidelines

Extension crash in Visual Studio 2022

mmoderau opened this issue · 2 comments

While the editor context menu is present, trying to add a guideline displays a Microsoft Visual Studio popup message:

The 'EditorGuidelinesPackage' package did not load correctly.
The message also instructs to check ActivityLog.xml.

First two entries related to guidelines in the log are:

  <entry>
    <record>1419</record>
    <time>2022/04/21 10:18:25.424</time>
    <type>Error</type>
    <source>Microsoft.VisualStudio.ComponentModelHost.VsShellComponentModelHost</source>
    <description>A MEF Component threw an exception at runtime: Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part &quot;EditorGuidelines.ColumnGuideAdornmentFactory&quot;. ---&gt; System.IO.FileNotFoundException: Could not load file or assembly &apos;Microsoft.ApplicationInsights, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&apos; or one of its dependencies. Nie mo&#x017C;na odnale&#x017A;&#x0107; okre&#x015B;lonego pliku.&#x000D;&#x000A;   at EditorGuidelines.ColumnGuideAdornmentFactory.OnImportsSatisfied()&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.InvokeOnImportsSatisfied()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.NotifyTransitiveImportsSatisfied()&#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>1463</record>
    <time>2022/04/21 10:18:36.087</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part &quot;EditorGuidelines.ColumnGuideAdornmentFactory&quot;. ---&gt; System.IO.FileNotFoundException: Could not load file or assembly &apos;Microsoft.ApplicationInsights, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&apos; or one of its dependencies. Nie mo&#x017C;na odnale&#x017A;&#x0107; okre&#x015B;lonego pliku.&#x000D;&#x000A;   at EditorGuidelines.ColumnGuideAdornmentFactory.OnImportsSatisfied()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()&#x000D;&#x000A;   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()&#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.InvokeOnImportsSatisfied()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.NotifyTransitiveImportsSatisfied()&#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 Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata](Object errorSource, Lazy`2 provider)</description>
  </entry>

Installed extensions:
Editor Guidelines
Visual Studio Theme Pack
Visual Studio IntelliCode
NuGetRecommender
Visual Studio Rich Navigation
JetBrains ReSharper

Thanks for the bug report, @mmoderau
This is almost certainly a duplicate of #87
There is a workaround: #87 (comment)

Closing as a likely duplicate. Please feel free to re-open if it's not actually a duplicate.