When manually adding NuGet packages, they are downloaded to the specified directory in nuget.config <repositoryPath> setting. However the package restore functionality ignores this setting and always downloads to \packages.
Steps to reproduce:
- in solution directory, create a file "nuget.config"
-
edit nuget.config and add:
<settings>
<repositoryPath>..\Dependencies</repositoryPath>
</settings>
- In visual studio, right-click on Solution, and select Manage NuGet Packages
- Install a package (any package)
- Verify that package was downloaded to ${SolutionDir}..\Dependencies
- delete the downloaded package in ${SolutionDir}..\Dependencies using windows explorer.
- In Visual Studio, right-click on Solution, and Enable NuGet Package Restore
- Rebuild solution (to trigger package restore of what you already deleted)
*** Error occurs here: Package Restore re-downlaods the package to the default ${SolutionDir}\packages instead of ${SolutionDir}..\Dependencies