How to clear nuget cache to get updated files on local

By | July 1, 2020

Many times we face wired problem like nuget packages are not getting updated locally, even after we take latest code and build or rebuild [or even clean and build] the solution properly. Then also latest nuget packages are not getting downloaded on local folder and we get some errors.

Solution 1: Clean the Nuget cache using command prompt.

  1. Download nuget package command line tool from this link.
  2. Open Command promt and go to the directory where nuget.exe was downloaded.

Now you can see the list of local nuget caches using below command,

nuget locals all -list

Now type following commands to clear the cache,

nuget locals all -clear

It will clear all the local caches. Now build the solution.


Solution 2 –  how to clear nuget cache though visual studio

Open visual studio, go to tools -> Nuget package manager -> Nuget package manager settings and then click on

Clear all nuget cache(s)