一、修改下载的NuGet包存储位置:
1、文件路径:
C:\Users\{登录用户名}\AppData\Roaming\NuGet
2、打开修改 “NuGet.Config”,文件内容
原始文件内容为:
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>
修改后的内容为:
<?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" /> <add key="repositoryPath" value="D:\NuGet\packages" /> </config> </configuration>
二、修改VS离线包引用地址:
1、问价路径
C:\Program Files (x86)\NuGet\Config
2、打开修改 “Microsoft.VisualStudio.Offline.config”,文件内容
原始文件内容:
xml version="1.0" encoding="utf-8"? <configuration> <packageSources> <add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\"/> </packageSources> configuration>
修改后的文件内容:
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="Microsoft Visual Studio Offline Packages" value="D:\NuGet\packages\"/> </packageSources> <config> <add key="globalPackagesFolder" value="F:\NuGet\packages\" /> </config> </configuration>
修改完成后重启VS,卸载包安装包一切正常,完成
标签:文件,路径,NuGet,修改,VS,内容 From: https://www.cnblogs.com/siyunianhua/p/18197018