1
votes

We have a large number of solutions in our source control, which all use NuGet packages from a custom source (http://nugetserver/nuget). All solutions restore and build successfully locally within Visual Studio.

Using the new TFS 2015, our build definition looks like this:

Tfs 2015 build definition steps

The NuGet Installer step is there for us to restore our packages from a custom resource:

enter image description here

There is however no NuGet.exe file in the custom NuGet server directory. As suggested here tried just setting the -source to "https://www.nuget.org/api/v2/". We receive the same error at build whichever source we use:

enter image description here

2

2 Answers

3
votes

You're specifying a command line argument in the "Path to NuGet.exe" field. That field should be used if you want to use a different version of NuGet than the one that's baked into the build agent.

What you need to do to solve your problem is:

  • Add your custom NuGet server to the machine's NuGet.config

or

  • Add your custom NuGet server to the application's NuGet.config.

See the NuGet docs for more info.

1
votes

You're specifying the command line in the wrong field. That field is to use different version of NuGet.exe. You need to put your command in the NuGet Arguments field.

Additionally you might want to also add the default NuGet Feed to the available sources like this:

-source "https://www.nuget.org/api/v2/;http://nugetserver/nuget"