Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.nuget Folder in User space

Tags:

Due to a problem with my storage, I need to delete or change location of many folder in my User space, but I see a .nuget folder and I would like to know if there is a way in Visual Studio 2016 to change the location of this folder?

It includes all the packages downloaded for my projects and it takes a lot of space.

Location of the .nuget folder

like image 969
Axeen Avatar asked Jul 02 '16 14:07

Axeen


People also ask

Can I delete user .NuGet folder?

Yes, the . nuget folder is used as a cache for packages downloaded to speed up project restore and compilation. It can safely be removed.

Where is the .NuGet folder?

The default is %userprofile%\. nuget\packages (Windows) or ~/. nuget/packages (Mac/Linux). A relative path can be used in project-specific nuget.

Can I delete .NuGet packages?

Uninstall a NuGet packageIn Solution Explorer, right-click either the Solution, the desired project, or the References in the project, and then select Manage NuGet Packages. Select the package to uninstall (use search to filter the list if necessary), and then select Uninstall.

How do I change the location of a NuGet package?

Open %AppData%\NuGet folder, open existing NuGet. Config file. Edit repositoryPath key and set new destination.


1 Answers

Set the globalPackagesFolder propety in your nuget.config and you can point this to any location on your drive. For an overview of the NuGet.config file check out our documentation here.

E.g

<configuration>
  <config>
    <add key="globalPackagesFolder" value="..\..\GlobalPackages2" />
  </config>
</configuration>
like image 133
Harikrishna Menon A Avatar answered Sep 23 '22 06:09

Harikrishna Menon A