How did I do?*

NuGet Package upgrade issues

When you're in the process of upgrading a solution to a more recent version of .NET, or restructuring a solution to improve project and code separation, you may find yourself having trouble installing or upgrading packages, or being unable to build the solution locally due to missing dependencies, conflicts, or unsupported target frameworks.

I found this most common when working with older .NET framework solutions which needed upgrading to at least the latest version of that generation (e.g. 4.5 to 4.8.2).

The packages.config (or equivalent) file lists the NuGet packages used by the projects, along with the target framework, which don't always get updated when you upgrade the framework itself.

This can be remedied by opening the Package Manager Console in Visual Studio (Tools > NuGet Package Manager > Package Manager Console) and running the following command:

Update-Package -reinstall

This updates the target framework reference for each package to the version of the framework being targeted by your project.