2
votes

I am trying to set up a CI/CD system and the company has chosen Visual Studio Team Services.

Everything was going well until I noticed my build failing here:

Error: d:\a_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe failed with return code: 1

Packages failed to install

The software project uses Telerik DLL's that are retrieved from a private Telerik nuget repo - which requires credentials to access.

Now obviously there must be a way to tell VSTS in the 'Nuget Restore' build step but I can't find anything online other than create our own hosted company Repo and tell VSTS about it - which isn't helpful because I don't want to host Telerik's own DLL's.

Is there any way to do this or should I move to TeamCity?

2

2 Answers

1
votes

The latest version (2.*) of the NuGet task supports both privately NuGet feeds and specifying the credentials for it (see screenshot). You simply need to leverage a NuGet configuration file to achieve this. Read Configure NuGet behavior for more details.

Also note that if you are using a hosted agent, your private NuGet repository must be publicly accessible. Otherwise you will need to run your build agent on the same network as your NuGet server.enter image description here

0
votes

It seems you are using Nuget Installer task which is deprecated now.

You can use NuGet task, detail settings as below:

enter image description here

Select restore command -> click New to add the credential from outside feed -> in the new window -> select basic authentication -> input feed URL, username and password -> verify the connect is successful -> Ok.

enter image description here

enter image description here

Save the build definition and queue again, now the nuget packages should be download successful by the NuGet task.