简体   繁体   English

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

[英]“The remote name could not be resolved: 'nuget.org'”

We are trying to setup CI in Visual studio environment using TFS. 我们正在尝试使用TFS在Visual Studio环境中设置CI。

Environment: 环境:

  • Windows 10 Windows 10

  • Microsoft Visual Studio 2017 Microsoft Visual Studio 2017年

  • MSVSTFS V 16.12 MSVSTFS V 16.12

  • NuGet V 4.0 NuGet V 4.0

Getting below error: 出现以下错误:

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'

Went through many links shared in the community by the developers which were of truly great help to understand the issue. 通过开发人员在社区中共享的许多链接进行了访问,这对于理解该问题确实有很大的帮助。

Some of my workarounds: 我的一些解决方法:

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

    • This explained about NuGet.config settings to be done 这解释了有关要完成的NuGet.config设置
  2. NuGet Behind Proxy NuGet落后于代理

    • Very resourceful stackoverflow chain, I followed the steps of creating a NuGet.config like exactly mentioned here and my config file looked of the form: 非常足智多谋的stackoverflow链,我按照此处确切提到的那样创建NuGet.config的步骤,并且我的配置文件看起来像这样:

我创建的NuGet.config

I am behind a company's firewall and we are trying to setup CI/CD pipeline. 我在公司防火墙后面,我们正在尝试设置CI / CD管道。

In TFS: 在TFS中: TFS生成NuGet错误

I am sure this a firewall proxy setting issue. 我确定这是防火墙代理设置的问题。 Since I am able to access "api.nuget.org" out of the network. 由于我能够通过网络访问"api.nuget.org"

Can someone suggest what is missing in NuGet.config to which i am pointing? 有人可以建议我指向的NuGet.config缺少什么吗? Any other inputs free to share. 任何其他共享的输入都可以自由共享。

Yes, if you want to use Nuget behind Proxy, you should follow the steps in Nuget.config 是的,如果要在代理后面使用Nuget,则应遵循Nuget.config的步骤

Since you have post the workaround above, however still get the error info in TFS. 由于您已经发布了上述解决方法,但是仍然在TFS中获得错误信息。

You should make sure you also changed the Nuget.config in your build agent/server. 您应该确保还更改了构建代理/服务器中的Nuget.config Win+R and enter %appdata%\\nuget to get the file location. Win + R,然后输入%appdata%\\nuget以获取文件位置。

Try to build directly through visual studio on the server instead of through TFS. 尝试直接通过服务器上的Visual Studio而不是TFS进行构建。 This will narrow down if the issue is related to your environment or TFS side. 如果问题与您的环境或TFS有关,则此范围将缩小。

Moreover, you could also Verbose Output to get more detail log info for troubleshooting: Enable Verbose Debug Mode for TFS Build vNext 此外,您也可以详细输出以获得更多详细的日志信息以进行故障排除: 为TFS Build vNext启用详细调试模式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM