1
votes

I have a Restore Nuget packages build step as part of my vNext (onsite premises TFS 2015) build.

This step allows you to configure Nuget arguments.

Here I have configured the source to pull from a local network share, where we store internal Nuget packages.

-source "\\myNetworkShare\Nuget Packages"

However, we also use public Nuget packages, such as Postsharp, etc.

I want this step to resolve from multiple sources (or at least two).

1 being the internal network share, the other being the public nuget.org server.

How is this possible?

1
How about add those sources in one nugget.config file? <packageSources> Check in the file in source control, then use the file in nugget install task.PatrickLu-MSFT

1 Answers

0
votes

Adding multiple source is supported in one NuGet config file. Specify your custom NuGet feed URL’s and the public Nuget packages server's url in the solution’s nuget.config file.

enter image description here

You need to set up your own nuget server instead of a local network share to hold the packages. Detail ways about this please refer How to host your own NuGet Server and Package Feed

Next, just continue to execute the default NuGet Restore step from build task. Now all packages will be restored and can be continue with the build.