Visual Studio 2017 - VSIX Package stops working after updating NuGet packages
See the question and my original answer on StackOverflowThere are many ways to fix this (mess). Here is one
- first, configure your Visual Studio 2017's Nuget to use the new Package Reference mode. https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files:
- delete the legacy
packages.config
file. - remove all existing references (see the picture below)
- edit the .csproj manually and remove all lines that contain "..packages..." stuff, including all lines that check for some nuget presences, and also the associated imports and tasks.
- add
Microsoft.VisualStudio.Shell.15.0
andNewtonsoft.Json
as a nuget packages. You should now see something like this (note the new nuget references with the blue icon):
- you should be able to compile and run successfully
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.