![](/img/trans.png)
[英]Is there a way to tell Visual Studio 2017 to stop trying to retrieve a package from both Nuget.org and a TFS 2017 feed?
[英]TFS2017 nuget restore try to connect to nuget.org
您可以在Nuget.Config文件中控制NuGet源。 在解决方案文件所在的文件夹中创建一个文件“ Nuget.config”。 在配置文件中,您可以清除所有源并定义自己的源。 例如,您可以如下设置packageSource
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="ThirdParty Nuget Repository" value="http://localNuget/artifactory/api/nuget/ThirdParty" />
</packageSources>
</configuration>
<clear />元素将清除您现有的Nuget源,而<add>元素将为您设置一个新的本地Nuget源。
有关Nuget配置文件的更多信息,请访问https://docs.microsoft.com/zh-cn/nuget/schema/nuget-config-file
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.