简体   繁体   中英

Visual Studio Online Build - nuget restore works on one agent, fails on another

I have two build servers, registered as agents in Visual Studio Online.

They both build everything but one solution just fine.

I have a git repo with dotnet core2 code, that references some nuget packages in a private nuget feed. The private nuget feed is confirmed working from both servers.

One server runs in interactive mode (server a), the other as a service (server b).

Server a - everything works. Server b - build always fails with this error:

error NU1101: Unable to find package . No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget.org [C:\\Agent_work\\13\\s\\MyProject\\MyProject.APIWeb.Tests\\MyProject.APIWeb.Tests.csproj]

I get this same error once for every project in the solution, that uses said nuget package.

Q: What am I missing here? Why is it trying to restore from a local cache on one server, but not the other one? Is there a kind of configuration, I need to make?

Based on the build log, it specify to download packages from nuget.org.

Since your project referred package(s) from your own private feed, you need to specify the private feed in NuGet restore task.

In NuGet restore task, you can specify your private feed as below:

Select Feeds in my NuGet.config option, you can specify the nuget.config file which contains the private feed with credential, or you can add the private feed as an endpoint as below:

New -> Basic Authentication -> input feed URL and credential -> OK.

Then you can select the private feed from drop down list.

在此处输入图片说明

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