Nuget modify the default storage location package

nuget default global package to download address is usually: C:. \ Users \ { UserName} \ nuget \ packages
after more than a project, nuget download package on the back slowly increases, resulting in a large number of c disk is occupied, this time we We want the default storage location nuget bag placed its other directory.

Can be repositioned by modifying globalPackagesFolder configuration items.

Nuget.config general default file stored in C: \ Users \ {UserName} \ AppData \ Roaming \ NuGet folder.

The default contents of the file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>

Add the following to the root node:

<config> 
    <add key="globalPackagesFolder" value="D:\nuget\packages" />
</config>

After the completion of the entire configuration file as follows:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
  <config> 
    <add key="globalPackagesFolder" value="D:\nuget\packages" />
</config>
</configuration>

After downloading the packages can be migrated to the new folder.

NOTE: {UserName} path for the system user name

Guess you like

Origin www.cnblogs.com/88223100/p/nuget-globalPackagesFolder-config.html