aws / aws-toolkit-visual-studio

AWS Toolkit for Visual Studio - a plugin to interact with AWS
https://aws.amazon.com/visualstudio/
Apache License 2.0
110 stars 29 forks source link

Visual Studio update to latest version throws error #440

Closed marcoschneidertui closed 4 months ago

marcoschneidertui commented 4 months ago

Describe the bug Hi, the new version of AWS Toolkit (including Q) unfortunately fails on update. In Visual Studio I receive this error message. image

When looking into the logs, I can find this entry:

<description>SetSite failed for package [AWSToolkitPackage]Source: &apos;Microsoft.VisualStudio.Composition&apos; Description: Expected 1 export(s) with contract name &quot;Amazon.AWSToolkit.Context.IToolkitContextProvider&quot; but found 0 after applying applicable constraints.&#x000D;&#x000A;Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name &quot;Amazon.AWSToolkit.Context.IToolkitContextProvider&quot; but found 0 after applying applicable constraints.&#x000D;&#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.GetExports(ImportDefinition importDefinition)&#x000D;&#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.GetExports[T,TMetadataView](String contractName, ImportCardinality cardinality)&#x000D;&#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T,TMetadataView](String contractName)&#x000D;&#x000A; at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]()&#x000D;&#x000A; at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]()&#x000D;&#x000A; at Amazon.AWSToolkit.VisualStudio.AWSToolkitPackage.&lt;GetMefComponentAsync&gt;d__721.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Amazon.AWSToolkit.VisualStudio.AWSToolkitPackage.<InitializeToolkitContextProviderAsync>d71.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Amazon.AWSToolkit.VisualStudio.AWSToolkitPackage.<InitializeAsync>d69.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Shell.AsyncPackage.<>c__DisplayClass21_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.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)`

The extension disappeared from Visual Studio Extensions Manager. It is no longer usable. Any manual update attempt is failing with the error message, that the Extension is already installed.

To Reproduce Steps to reproduce the behavior

  1. My extension is set to automatically update on new version
  2. After starting Visual Studio, the above described error happens

Development System (please complete the following information):

marcoschneidertui commented 4 months ago

I could finally solve it by deinstalling the extension. This was not possible through Visual Studio Extensions Manager as, as said, the extension was no longer showing up there. Using cli I was finally able to remove it. vsixinstaller /uninstall:0B82CB16-0E52-4363-9BC0-61E758689176

After reinstalling the extension, it was showing up in Extensions Manager again and seem to be functional again.

marcoschneidertui commented 4 months ago

Next finding. After re-opening (or opening a second instance of Visual Studio), the extension disappeared again: image

drazenzadravec commented 4 months ago

I had the same issue, uninstalled as above: '.\VSIXInstaller.exe /u:0B82CB16-0E52-4363-9BC0-61E758689176'. Worked when I restarted VS 2022, exited VS 2022. Restarted VS 2022 about 2 hours from last exit, the issue as described above in the screen shot with the dialog window reappeared. At this point I am waiting for a resolution.

marcoschneidertui commented 4 months ago

After reinstalling, I immediately started 2 instances of visual studio, together with 2 different solutions. The first one got Amazon Q operational, the second instance not: image

After closing, no instance with Amazon Q was launched and I had to reinstall everything again.

awschristou commented 4 months ago

Hi, and thank you for sharing details (particularly the ActivityLog.xml contents) relating to installing version 1.54.0.0. We are actively looking into this at the moment.

@marcoschneidertui in https://github.com/aws/aws-toolkit-visual-studio/issues/440#issuecomment-2205365933, when you have two separate windows open, do both windows have a C# file open?

awschristou commented 4 months ago

I will close this issue as a duplicate of #441, in order to have a single place to track this loading problem.