Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to delete .nuget folder inside my user profile folder?

I used Visual Studio to do some tests but I have already uninstalled it.

Has the ".nuget" folder (under my user profile) been created by Visual Studio and can I safely remove it now?

like image 676
roughnecks Avatar asked Oct 29 '18 14:10

roughnecks


People also ask

Can I delete .NuGet packages?

If you want to delete/uninstall Nuget package which is applied to multiple projects in your solutions then go to: Tools-> Nuget Package Manager -> Manage Nuget Packages for Solution. In the left column where is 'Installed packages' select 'All', so you'll see a list of installed packages and Manage button across them.

Where is the .NuGet folder?

The location of the default global packages folder. The default is %userprofile%\. nuget\packages (Windows) or ~/. nuget/packages (Mac/Linux).

Can I delete Visual Studio packages folder?

YES you can delete this directory, if you have uninstalled Visual Studio.

How do I clean up NuGet packages?

Open Visual Studio, go to Tools -> NuGet Package Manager -> Package Manager Settings menu. Click Clear All NuGet Cache(s) button in options dialog then clearing process is started. Once NuGet cache location is cleared, click ok button.


2 Answers

Yes, the .nuget folder is used as a cache for packages downloaded to speed up project restore and compilation. It can safely be removed. Worst case, it will have to download the packages again in the future.

like image 69
jessehouwing Avatar answered Oct 18 '22 00:10

jessehouwing


Just to follow up on the answer @jessehouwing gave, here is the official documentation explaining the different package folders and how to manage them via supported tooling: https://learn.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders

like image 12
tstuts Avatar answered Oct 17 '22 23:10

tstuts