I've created a solution that uses multiple class library projects with their own GitHub repositories and Visual Studio correctly recognizes each project's repo and commits changes to each project's own GitHub repository.
Additionally, each class library project has a nuget.config
file in its root that tells it where to get Nuget packages from and some of the Nuget packages are from my private package registry on GitHub.
Everything works fine individually because when I make changes to them, I simply commit them to their respective GitHub repositories after making any Nuget reference changes. Then GitHub actions kick in and create new versions of their Nuget packages.
However, in my new solution that references a few of these class libraries, Visual Studio doesn't seem to restore any of the packages from my private package registry. It looks like the nuget.config
files in each project's root have no effect on helping Visual Studio finding my packages.
How do I need to set up Visual Studio and/or my new solution using these class libraries so that when I open the solution, all the Nuget packages are restored, whether they come from Nuget.org or my private package registry on GitHub?
BTW, I'm on the latest version of Visual Studio i.e. 17.8.0 on Windows.
NuGet's official documentation explains: https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior
So, you have to move the nuget.config file to the solution directory. nuget.config files in project directories are not loaded.