简体   繁体   中英

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

We are trying to setup CI in Visual studio environment using TFS.

Environment:

  • Windows 10

  • Microsoft Visual Studio 2017

  • MSVSTFS V 16.12

  • 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

    • This explained about NuGet.config settings to be done
  2. NuGet Behind Proxy

    • 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:

我创建的NuGet.config

I am behind a company's firewall and we are trying to setup CI/CD pipeline.

In 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.

Can someone suggest what is missing in NuGet.config to which i am pointing? Any other inputs free to share.

Yes, if you want to use Nuget behind Proxy, you should follow the steps in Nuget.config

Since you have post the workaround above, however still get the error info in TFS.

You should make sure you also changed the Nuget.config in your build agent/server. Win+R and enter %appdata%\\nuget to get the file location.

Try to build directly through visual studio on the server instead of through TFS. This will narrow down if the issue is related to your environment or TFS side.

Moreover, you could also Verbose Output to get more detail log info for troubleshooting: Enable Verbose Debug Mode for TFS Build vNext

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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