Is it possible to change the nuget package cache path from %UserProfile%\.nuget\packages
to a custom location?
I tried using the environment variable NuGetCachePath, but it doesn't seem to work with it.
Open %AppData%\NuGet folder, open existing NuGet. Config file. Edit repositoryPath key and set new destination.
Move the package cache One way to do this is by transferring the files to any letter drive or NTFS file system (e.g., another mount, hard disk, USB device, and network drive). You will need to create a junction between the old location and the new location.
NuGet 3.5 and earlier uses packages-cache instead of the http-cache, which is located in %localappdata%\NuGet\Cache . By using the cache and global-packages folders, NuGet generally avoids downloading packages that already exist on the computer, improving the performance of install, update, and restore operations.
The global-packages folder is where NuGet installs any downloaded package. Each package is fully expanded into a subfolder that matches the package identifier and version number. Projects using the PackageReference format always use packages directly from this folder.
You can modify the location of the package cache by setting an environment variable named NUGET_PACKAGES
.
For example, change your location from C:\Users\Frank\.nuget\packages
to F:\Users\Frank\.nuget\packages
by setting the latter value to a "system" environment variable named NUGET_PACKAGES
, and rebooting.
Reference: https://github.com/NuGet/Home/issues/1905
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With