loop8ack / ExtensionPackTools

Import and export lists of Visual Studio extensions.
Other
78 stars 15 forks source link

VS2019 Preview 3: Fails to load assembly 'Microsoft.VisualStudio.ExtensionManager' #7

Closed richardcox13 closed 5 years ago

richardcox13 commented 5 years ago

Having updated from VS2019 Preview 2.2 to Preview 3.0 I'm getting extension load errors.

Looking in my ActivityLog.xml I see

SetSite failed for package [VsPackage]Source: 'ExtensionManager' Description: Could not load file or assembly 'Microsoft.VisualStudio.ExtensionManager, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.ExtensionManager, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.VisualStudio.ExtensionManager, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at ExtensionManager.VsPackage.d0.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at ExtensionManager.VsPackage.InitializeAsync(CancellationToken cancellationToken, IProgress`1 progress) at Microsoft.VisualStudio.Shell.AsyncPackage.<>cDisplayClass19_0.<b1>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.d68.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e) at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck) at Microsoft.VisualStudio.Services.VsTask.GetResult() WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

(There are no other errors or warnings before this one.)

Disabling Extension Manager reduces it to one error popup, and a single error in ActivityLog.xml

luedi commented 5 years ago

Even deinstalling the extension will not eliminate the error. After deinstalling i have two errors in ActivityLog.xml. I'm not sure if the fisrt one belongs to the Extension manager:

Failed to send telemetry with error: 'The scoped user task is already ended.'

System.IO.FileNotFoundException: Could not load file or assembly

'Microsoft.VisualStudio.ExtensionManager, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Das System kann die angegebene Datei nicht finden. File name: 'Microsoft.VisualStudio.ExtensionManager, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at FixMixedTabs.MarginFactory.CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin) at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.b__27_1(IWpfTextViewMarginProvider mp) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy2 provider, Func2 getter) --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject) WRN: Protokollierung der Assemblybindung ist AUS. Sie können die Protokollierung der Assemblybindungsfehler aktivieren, indem Sie den Registrierungswert [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) auf 1 festlegen. Hinweis: Die Protokollierung der Assemblybindungsfehler führt zu einer gewissen Leistungseinbuße. Sie können dieses Feature deaktivieren, indem Sie den Registrierungswert [HKLM\Software\Microsoft\Fusion!EnableLog] entfernen.

madskristensen commented 5 years ago

Issue is fixed. I've had to split the extension into separate installs - one for VS 2017 and one for 2019

luedi commented 5 years ago

For me, the issue is not gone, also after deinsatlling / reinstalling the extension in VS2019. If i start VS2019 without loading a solution everything is fine, but when i load a solution, the error occurs. I guess there is a registry entry left after an unsucessful deinstallation.

DoCode commented 5 years ago

@madskristensen should v0.6.40 solve this issue?
On my machine, it doesn't!

madskristensen commented 5 years ago

In VS 2019 you need to uninstall the Extension Manager extension. After that, install Extension Manager 2019 which is a new extension with a separate ProductID referencing the VS2019 API instead of the VS2017 one. The code is identical

DoCode commented 5 years ago

@madskristensen thanks. Ah, I see. The 2017's extensions were installed. After removing both, install the new one, all works nice!

luedi commented 5 years ago

I also tried to deinstall and reinstall the extension manager, both for VS2017 and VS2109. But this didn't also work.

richardcox13 commented 5 years ago

In VS2019 Preview 3 I removed Extension Manager, shutdown to let extension update complete. Restarted adding Extension Manager 2019, and again shutdown to let extension update complete. On loading a solution in VS2019 I got an error reported. The text in ActivityLog.xml is not quite the same (see below).

Not knowing too much about extensions: could this be from an extension that was originally loaded with Extension Manager?

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.ExtensionManager, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.VisualStudio.ExtensionManager, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at FixMixedTabs.MarginFactory.CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin) at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.b__27_1(IWpfTextViewMarginProvider mp) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy2 provider, Func2 getter) --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject) WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value

madskristensen commented 5 years ago

@richardcox13 That is a bug in the FixMixedTab extension from Productivity Power Tools. They are aware of the problem and working on a fix. I'm closing the issue here since it was fixed in this extension

richardcox13 commented 5 years ago

@madskristensen Thanks for the confirmation