I have the following convention for most of my projects:
/src
/Solution.sln
/SolutionFolder
/Project1
/Project2
/etc..
/lib
/Moq
moq.dll
license.txt
/Yui-Compressor
yui.compressor.dll
/tools
/ILMerge
ilmerge.exe
You'll notice that I do not keep external libraries inside the source folder. I'm also very interested in using NuGet but don't want these external libraries inside the source folder. Does NuGet have a setting to change the directory that all packages are loaded into?
The most consistent way is via using
nuget config
to correctly set the config:https://docs.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#changing-config-settings
In order to change the path for projects using PackageReference instead of packages.config you need to use
globalPackagesFolder
From https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file
I put Nuget.config next to my solution file and it worked.