Clearing the nuget cache
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: Clear the Nuget cache using command prompt.
- Download nuget package command line tool from this link.
- 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)