Restoring NuGet packages from custom Nugetserver using TFS Build 2015

余生颓废 提交于 2019-12-08 05:47:27

问题


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:

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

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:


回答1:


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.




回答2:


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"



来源:https://stackoverflow.com/questions/32847444/restoring-nuget-packages-from-custom-nugetserver-using-tfs-build-2015

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!