Steps to reproduce:
Build your VSIX package again. You may have to supress the warning around this statement:
public static async Task InitializeAsync(AsyncPackage package)
{
// Verify the current thread is the UI thread - the call to AddCommand in Command1's constructor requires
// the UI thread.
#pragma warning disable VSTHRD109 // Switch instead of assert in async methods
ThreadHelper.ThrowIfNotOnUIThread();
#pragma warning restore VSTHRD109 // Switch instead of assert in async methods
OleMenuCommandService commandService = await package.GetServiceAsync((typeof(IMenuCommandService))) as OleMenuCommandService;
Instance = new Command1(package, commandService);
}
Debug your VSIX package again.
If you follow the instructions to the %AppData% directory and read the activity log, you'll see that the Microsoft.VisualStudio.Threading 15.8.0.0 assembly can't be loaded.
Could not load file or assembly 'Microsoft.VisualStudio.Threading, Version=15.8.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.Threading, Version=15.8.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
There are many ways to fix this (mess). Here is one
packages.config
file.Microsoft.VisualStudio.Shell.15.0
and Newtonsoft.Json
as a nuget packages. You should now see something like this (note the new nuget references with the blue icon):For a few months now, everytime I face impossible nuget issues, that's what I do. I copy the old packages.config somewhere, delete it from the project, remember the "root" packages, remove every reference, check the csproj, and add the new references from nuget (trying to add the fewest possible so the child references are ok). Nuget is the future for all references now (we'll have to bite the bullet whether we like it or not), even for Visual Studio ones.