Debugging Exceptions Caused by a Visual Studio Extension

I am running Visual Studio 2015 with some extensions.
I am trying to debug the following error that I am getting:

Excluded event.  This may be caused by the extension.

Errors are recorded in ActivityLog.xml:

440 ERROR A MEF Component threw an exception at runtime: System.InvalidCastException: Unable to cast object of type 'System.Reflection.RuntimeMethodInfo' to type 'System.Reflection.ConstructorInfo'. 
  at Microsoft.VisualStudio.Composition.Reflection.ResolverExtensions.Resolve(ConstructorRef constructorRef) 
  at Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimePart.get_ImportingConstructor() 
  at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue() 
  at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create() 
  at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState) 
  at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState) 
  at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose() 
  at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()   
  Source: Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost 
  Time: 2016/09/12 07:16:43.932 

441 ERROR System.InvalidCastException: Unable to cast object of type 'System.Reflection.RuntimeMethodInfo' to type 'System.Reflection.ConstructorInfo'. 
  at Microsoft.VisualStudio.Composition.Reflection.ResolverExtensions.Resolve(ConstructorRef constructorRef) 
  at Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimePart.get_ImportingConstructor() 
  at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue() 
  at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create() 
  at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState) 
  at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState) 
  at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose() 
  at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0() --- End of stack trace from previous location where exception was thrown --- 
  at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0() 
  at Microsoft.VisualStudio.Composition.DelegateServices.<>c__DisplayClass2_0`1.<As>b__0() 
  at System.Lazy`1.CreateValue() 
  at System.Lazy`1.LazyInitValue() 
  at System.Lazy`1.get_Value() 
  at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InvokeEligibleFactories[TExtensionInstance,TExtensionFactory,TMetadataView](IEnumerable`1 lazyFactories, Func`2 getter, IContentType dataContentType, IContentTypeRegistryService contentTypeRegistryService, Object errorSource)   
  Source: Editor or Editor Extension 
  Time: 2016/09/12 07:16:44.075 

Errors are reported with Sourcefrom Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHostand Editor or Editor Extension.

The errors do not mention which extension caused the error, and I cannot find any clues where to look for the problem.

When working with the debugger ( devenv.exe" /RootSuffix Exp), the debugger does not stop with exceptions, and a window appears with an error message.

Any idea on how to further debug this to find out which extension caused the problem and where in the extension the problem might have occurred?


Update

Visual Studio, , .. .
, , / .

+4
4

, Visual Studio , , . () , Visual Studio. , . , . , , :

devenv /updateconfiguration

.

+4

Visual Studio 2015 Update 3 ( ) "":

Visual Studio 2015 > Reset Visual Studio 2015

, :

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VSSDK\
 VisualStudioIntegration\Tools\Bin\CreateExpInstance.exe"
 /Reset /VSInstance=14.0 /RootSuffix=Exp

, , .

+9

, , VS :

devenv/SafeMode

, .

, , VS IDE.

:

http://blog.masterdevs.com/debugging-a-visual-studio-crash/

" DLL ", , , , temp/AppData, , .

+1

I solved the problem by deleting each corresponding directory in <user>\AppData\Local\Microsoft\VisualStudio\

(calling the "lower level" reset does not work because it could not find the directory blahblah\15.0Exp\.)

Btw, I am using VS2017RCUpdate3.

-1
source

Source: https://habr.com/ru/post/1654314/


All Articles