"无法解析远程名称:' nuget.org'"

时间:2018-04-13 22:39:29

标签: visual-studio tfs nuget azure-devops nuget-package

我们正尝试使用TFS在Visual Studio环境中设置CI。

环境:

  • Windows 10

  • Microsoft Visual Studio 2017

  • MSVSTFS V 16.12

  • NuGet V 4.0

获取以下错误:

https://api.nuget.org/v3/index.json: 
Unable to load the service index for source https://api.nuget.org/v3/index.json.
An error occurred while sending the request.
The remote name could not be resolved: 'api.nuget.org'

通过开发人员在社区中共享的许多链接,这些链接对于理解该问题非常有帮助。

我的一些解决方法:

  1. http://skolima.blogspot.ru/2012/07/nuget-proxy-settings.html

    • 这解释了要完成的NuGet.config设置
  2. NuGet Behind Proxy

    • 非常资源丰富的stackoverflow链,我按照创建一个NuGet.config的步骤,就像这里提到的那样,我的配置文件看起来像这样:
  3. NuGet.config which I created

    我支持公司的防火墙,我们正在尝试设置CI / CD管道。

    在TFS中: TFS Build NuGet Error

    我确定这是防火墙代理设置问题。因为我能够从网络中访问"api.nuget.org"

    有人可以建议我指向的NuGet.config中缺少什么吗?任何其他输入可以免费分享。

1 个答案:

答案 0 :(得分:0)

是的,如果你想在代理服务器后面使用Nuget,你应该按照Nuget.config

中的步骤进行操作

由于您已发布上述解决方法,但仍会在TFS中获取错误信息。

您应确保还更改了构建代理/服务器中的Nuget.config。赢+ R并输入 %appdata%\nuget获取文件位置。

尝试直接通过服务器上的visual studio而不是通过TFS构建。如果问题与您的环境或TFS方面有关,这将缩小范围。

此外,您还可以使用详细输出来获取更多详细日志信息以进行故障排除:Enable Verbose Debug Mode for TFS Build vNext

相关问题