Clear Nuget Cache

If library’s have the same name you can clear your cache with these commands. This can happen when you are developing and testing a new version of the library.

I downloaded the Nuget executable from nuget.org then saved it to c:\Data\Nuget

You can save it to any location and add that path to your Environment Variables’ under “Path” – I didn’t see the value for this exercise.

1
2
nuget locals all -list
nuget locals all -clear

Example output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
C:\Users\Carl>cd c:\Data\nuget\

c:\Data\Nuget>nuget locals all -list
http-cache: C:\Users\Carl\AppData\Local\NuGet\v3-cache
global-packages: C:\Users\Carl\.nuget\packages\
temp: C:\Users\Carl\AppData\Local\Temp\NuGetScratch

c:\Data\Nuget>nuget locals all -clear
Clearing NuGet HTTP cache: C:\Users\Carl\AppData\Local\NuGet\v3-cache
Clearing NuGet global packages cache: C:\Users\Carl\.nuget\packages\
Clearing NuGet Temp cache: C:\Users\Carl\AppData\Local\Temp\NuGetScratch
Local resources cleared.

c:\Data\Nuget>