We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to clear NuGet cache?

Whenever a new NuGet package is installed, the NuGet package will be stored in NuGet cache location and afterwards that particular NuGet package with same version will be referred from the cache location instead of the package sources that we are configured in package manger/packages.config. If some NuGet package is updated/refreshed/patched with some additional changes with same version, it is always better to clear NuGet cache before install the updated NuGet package with same version.

 

By performing the following steps we can clear the NuGet cache locations.

 

  1. Download the latest NuGet executable from here.
  2. Navigate the directory of the downloaded exe in command window and run the following command.   

 

OS

Command

Windows

nuget locals <all | http-cache | packages-cache | global-packages | temp> -clear

Mac

mono nuget.exe locals <all | http-cache | packages-cache | global-packages | temp> -clear

 

For Example:

 

OS

Command

Screenshot

Windows

nuget locals all -clear 

 

http://www.syncfusion.com/downloads/support/directtrac/159262/660028254_3c320835.PNG

 

Mac

mono nuget.exe locals all -clear

 

 

   

  1. Now the NuGet packages will get removed from cache location.

 

Note: The above command will clear all the NuGet packages from cache location. So once cleared the NuGet cache location then every NuGet package will be downloaded/restored from source location to cache location again. If we want to avoid this case, we can navigate to NuGet cache location and delete the particular NuGet package manually. Find the NuGet cache locations by using the below command.

 

OS

Command

Screenshot

Windows

nuget locals all -list

 

 

Mac

mono nuget.exe locals all -list

 

 

 

Navigate the listed cache locations by file explorer(Windows)/finder(Mac) and remove the unrequired NuGet packages manually.

Article ID: Published Date: Last Revised Date: Platform: Control:
6987 07/19/2016 09/26/2017 Miscellaneous Extension
Did you find this information helpful?
Comments
Jan Rosa Sep 25, 2017

Please note that on OSX the cache is in by default, is .nuget/packages in the user's home directory


Reply
Abbas K [Syncfusion] Sep 26, 2017

Hi Jan,


Thank you for notifying us, the KB has been republished and also the details have been added.


Thanks,

Abbas K

Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.