问题
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
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.
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?
回答1:
@Jasper, Hi, I'm Keith and I work on the packaging team at MSFT.
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.
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).
来源:https://stackoverflow.com/questions/45369334/vsts-nuget-restore-fails-proxy