VSTS NuGet还原失败(代理?) [英] VSTS NuGet restore fails (proxy?)

查看:168
本文介绍了VSTS NuGet还原失败(代理?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我们一直在使用Azure VM来构建我们的应用程序.由于法律要求,我们被指示将这些活动转移到位于代理后面的本地服务器上.现在,我看到构建失败并显示以下日志消息:

Up to now we've been using Azure VM's for building our application. Because of legal requirements we were instructed to move these activities to an on-prem server which resides behind a proxy. Now I see the builds are failing with the following log message:

##[error]getaddrinfo ENOTFOUND dist.nuget.org dist.nuget.org:443

所以我假设这可能是由于nuget代理配置所致.因此,我尝试添加具有正确代理设置的nuget.config文件,然后将其检查到解决方案中,但这没有任何改变.还尝试下载CLI并设置nuget代理配置设置,但仍然无济于事.

So I am assuming this might be due to the nuget proxy config. So I've tried adding a nuget.config file with the correct proxy settings and checking that one in to the solution, but that didn't change anything. Also tried downloading the CLI and setting the nuget proxy config setting, but again to no avail.

奇怪的是;当我从cmd在本地运行命令时,一切正常!所以我一定在这里想念什么,但是呢?

The weird thing is; when I run the command locally from cmd, it all works fine!? So I must be missing something here, but what?

推荐答案

@Jasper, 我是Keith,我在MSFT的包装团队工作.

@Jasper, Hi, I'm Keith and I work on the packaging team at MSFT.

您似乎正在使用 nuget工具安装程序以在运行构建任务之前获取nuget.您可以确认是这种情况吗?如果是这种情况,则工具安装程序存在一个已知问题,即不遵守已修复的构建代理的代理设置.

It looks like you may be using the nuget tool installer to fetch nuget before running a build task. Can you confirm that this is the case? If this is your situation there is a known problem with the tool installer not respecting the proxy settings of the build agent that is being fixed.

此外,您无需在nuget.config中设置代理设置.您应该通过此方法在构建代理中进行设置. nuget构建任务的v2.*版本将发现代理的代理设置,并在适当的时候使用它们(例如,还原).

Also, you should not need to set proxy settings in your nuget.config. You should set them in the build agent via this method. The v2.* version of the nuget build task will discover the agent's proxy settings and use them when appropriate (e.g. restore).

这篇关于VSTS NuGet还原失败(代理?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆