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.
Yes, the . nuget folder is used as a cache for packages downloaded to speed up project restore and compilation. It can safely be removed.
The default is %userprofile%\. nuget\packages (Windows) or ~/. nuget/packages (Mac/Linux). A relative path can be used in project-specific nuget.
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.
Open %AppData%\NuGet folder, open existing NuGet. Config file. Edit repositoryPath key and set new destination.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With