In Visual Studio 2019 16.11.5 (latest) I have the 'Visual Studio extension development' workload installed.
I can use this to create a C# VSIX Project. If I do this it builds and runs fine as you'd expect, and has no compiler warnings or errors.
If I go to Tools/Manage NuGet Packages for solution... I can see I have NuGet package Microsoft.VisualStudio.SDK v16.0.206 installed, but the latest version is v16.10.31321.278.
If I go to the Updates tab I can select the package and click 'Update' to get the latest version.
The project still builds and runs after I do this, but I get a compiler warning about version incompatibilities of dependent libraries:
Found conflicts between different versions of "Microsoft.VisualStudio.Validation" that could not be resolved. There was a conflict between "Microsoft.VisualStudio.Validation, Version=16.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "Microsoft.VisualStudio.Validation, Version=16.10.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". "Microsoft.VisualStudio.Validation, Version=16.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "Microsoft.VisualStudio.Validation, Version=16.10.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
There are more details about where the incompatibility arose, which appear to say the main package references 16.9.0 and some of the dependent libraries reference 16.10.0. If I look in project.assets.json I can see that the build actually uses v16.9.32.
So the question is: what is the correct course of action to remove this compiler warning and safely use the latest SDK to build my VSIX?
Having read around this I see a few options. I can suppress the warning, but I can't see how since it has no code. I can not upgrade the package. Or I can install a specific version of Microsoft.VisualStudio.Validation and use a binding redirect to get rid of the warning, although I don't know what the version should be. If the assembly uses semver it would seem that 16.10.x would be the right library, not the 16.9.32 the build is using.