Use user NuGet.config, not NUGET_PACKAGES environment variable #4009
Labels
Issue-Bug
Something isn't working or needs investigation
Needs-Triage
New issue that the core contributors need to triage
Dev Home version
0.1901.687.0
Windows build number
No response
Other software
NuGet - all versions
Steps to reproduce the bug
Expected result
It changes the global nuget package folder using %APPDATA%\NuGet\NuGet.config
Actual result
It changes the package folder using NUGET_PACKAGES environment variable.
The problem with this is that it wins over a repo-local NuGet.config. This is documented and by-design in NuGet.
NuGet/Home#4810 (comment)
https://learn.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders
I lost nearly a whole day finding this out the hard way.
There are many examples of repos that set globalPackagesFolder in repo-local config and customers could easily get bit too:
https://github.com/search?q=globalPackagesFolder+path%3A**%2Fnuget.config&type=code&ref=advsearch
The documentation should also be fixed here:
https://learn.microsoft.com/en-us/windows/dev-drive/#storing-package-cache-on-dev-drive
MicrosoftDocs/windows-dev-docs#5236
Included System Information
No response
Included Extensions Information
No response
The text was updated successfully, but these errors were encountered: