Reputation: 18068
I created a build definition in VSTS for our project. In the NuGet Installer step I specify:
Path to solution or packages.config: DirectoryName/AppServer/.nuget/NuGet.Config
Path to NuGet.config: DirectoryName/AppServer/.nuget/NuGet.Config
Installation type: Restore
NuGet arguments: -PackagesDirectory DirectoryName\SDK\NuGet\packages
NuGet Version: 3.3.0
When I run the build execution, I get info on the console:
2017-07-31T11:39:10.2496191Z ##[section]Starting: NuGet restore DirectoryName/AppServer/AppServer.sln
2017-07-31T11:39:10.2808709Z ==============================================================================
2017-07-31T11:39:10.2808709Z Task : NuGet Installer
2017-07-31T11:39:10.2808709Z Description : Installs or restores missing NuGet packages
2017-07-31T11:39:10.2808709Z Version : 0.2.31
2017-07-31T11:39:10.2808709Z Author : Microsoft Corporation
2017-07-31T11:39:10.2808709Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747)
it restores a lot of packages, but some are not restored. No errors are thrown, no warnings, they are just omitted and that causes the Build solution task to fail.
However, when I log onto virtual machine (Azure) and open the solution in Visual Studio 2017 and click on every project in it one by one and right click on it, then restore NuGet packages, everything is downloaded successfully. Then build definition execution is a success under condition that I set Clean to false in Get sources step.
Upvotes: 0
Views: 86
Reputation: 33728
Try to use NuGet 4.0.0 version (specify it in Advanced section of NuGet Installer task).
On the other hand, there are 1.*
and 2.*
versions of NuGet task available, you can use the newest version of task.
Upvotes: 1
Reputation: 5004
This caught my attention:
and click on every project in it one by one
This is probably not the same that your VSTS automation is doing, is it?
One possible cause is that one of your projects is referencing a nuget resource from it's packages folder, but the reference is missing from packages.config. If some other project has the package correctly referenced then it happens to magically be available, but only when someone has compiled that project first. If that project is not built then your incorrectly configured project would fail as well.
So I would suggest you to:
Also, you should verify the logs and build errors not by manually compiling every single project but reproducing the exact steps that your build server is doing. Which usually is to clean and build the entire solution.
Upvotes: 0