Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the NuGet 3.2 package cache location be changed

Tags:

I have a machine whose C:\ drive has limited space, but I have a large D:\ drive with plenty of space is it possible to change the location of the nuget package cache (I am using nuget 3.x)?

like image 229
Damian Avatar asked Feb 29 '16 22:02

Damian


2 Answers

Set an environment variable NuGetCachePath with the value of the path where you want the new package cache.

UPDATE: This answer is from 2016 and is no longer relevant for more modern versions of NuGet. As indicated below by @Mohsen the new Environment Variable to set is NUGET_PACKAGES

Environment variable window

like image 186
John Koerner Avatar answered Sep 20 '22 16:09

John Koerner


You can override the default nuget package cache folder by an environment variable:

NUGET_PACKAGES

Reference: Manage Global Packages and Cache Folder

like image 34
Mohsen Afshin Avatar answered Sep 19 '22 16:09

Mohsen Afshin