Does anyone know of a way to make Visual Studio apply the NuGet package sources configuration per solution instead of across all solutions? I keep having versioning problems be
TLDR: Yes
NuGet uses a hierarchical application of package sources starting with the NuGet.config at the level of your Windows User Profile and then applying more and more granular configuration starting at the root of the file path that contains your solution, finally ending with the directory containing your solution file.
So here's what I've managed to figure out - courtesy of a helpful Twitterer pointing me to this document:
https://docs.nuget.org/consume/nuget-config-file
When you edit the NuGet package sources in Visual Studio's Tools > NuGet Package Manager > Package Manager Settings: Package Sources
option, it applies those changes by default to the NuGet.config file found in your %APPDATA%\NuGet
directory. To override these settings on a per-solution (or per group of solutions) basis, you need to add a strategically placed NuGet.config file somewhere along the path of your solution or solutions.
All will become clear if you read the NuGet document, the solution I provide below will quickly allow you to specify a configuration for a single Visual Studio solution:
If you want a configuration to apply to multiple solutions, ensure your solution folders are all contained within a common directory and put the NuGet.config for the package sources relevant for those solutions in that common directory, ensuring that any solution folders for projects that aren't to use these package sources are not contained in this common folder.