How to trigger NuGet v2.x Package Restore from CruiseControl.Net
Asked Answered
M

1

7

Is it possible to trigger a NuGet v2.x package restore when trying to build a VS2010 solution using CruiseControl.Net?

We've recently set up CCNET and are simply trying to trigger a test build of our main solution. Many projects within the main solution have NuGet package restore enabled. The packages folder is not committed to our VCS. Because of the new "feature" of having to consent to the package restore in Visual Studio, MSBuild is failing when it hits the restore package target in the nuget.targets file.

If it is possible without drastic changes to every project that uses NuGet or to write a custom build script, what is the best way to accomplish the package restore?

Meek answered 5/12, 2012 at 20:13 Comment(0)
O
7

from http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages To enable package restore for build servers without Visual Studio installed, you can also set the environment variable EnableNuGetPackageRestore to "true".

Oly answered 5/12, 2012 at 23:6 Comment(6)
Yes, and of course now, because we use our own internal NuGet server, I need to figure out how to set it up such that it knows about the internal server for the package restore. I wish the folks at NuGet would make the one sentence about EnableNuGetPackageRestore more prominent.Meek
For some reason, this by itself didn't work for me for Nuget 3.3. I also had to download nuget.exe to CCNet machine and add the following for each solution with packages: <exec executable="C:\Program Files (x86)\NuGet\nuget.exe"> <buildArgs>restore C:\SomeSolution.sln</buildArgs> </exec> before msbuild task.Marianelamariani
I used your solution @Marianelamariani but for some reason, this will fail without a log being produced.Incontrollable
@Anders Do you have Nuget Command-Line Utility (docs.nuget.org/consume/installing-nuget) on the given path?Marianelamariani
@Marianelamariani yes, but if I change the name of the nuget.exe command line, misspelling it deliberately, I get the same result: "Log does not contain any XML output from MSBuild."Incontrollable
@Andres Can you post the configuration so. can take a look? I probably won't be able to help much, as I don't have that environment set up any more, and was struggling with it myself when I had it, but I can try.Marianelamariani

© 2022 - 2024 — McMap. All rights reserved.