![](/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.