You can do this using Visual Studio menu on UI or by using command. You have two ways to do this. Let’s check:
First Option:
Let’s move with first option, we can clear our development computer’s NuGet package cache using Visual Studio menu Tools → Options → NuGet Package Manager → General: “Clear Package Cache” button.
Second Option:
First, download the NuGet command line tool from here. Now, open command prompt and type cd to the directory to which nuget.exe was downloaded.
You can list the local caches with this command:
nuget locals all --list
You can clear all caches with this command:
nuget locals all --clear
In case of .Net core you can use following command to clear cache
dotnet nuget locals all --clear
Check More:
- Get TFS to ignore NuGet packages folder
- Unlocking files and folders locked by some employee on TFS
- How can I clear the NuGet package cache using the command line?
- How to get the nuget cache folder location programmatically
I hope you enjoyed reading this post. For more information you can check out Microsoft learn.
For more information you can visit our C# Section for more such posts.