4
votes

A TeamCity build fails. It is failing to update a NuGet package to a particular version, which is available on a feed actually provided by TeamCity itself.

E:\TeamCity-BuildAgent\work\62023563850993a7\Web.nuget\nuget.targets(88, 9): Unable to find version '1.0.17.0' of package 'MarkLogicManager40'.

E:\TeamCity-BuildAgent\work\62023563850993a7\Web.nuget\nuget.targets(88, 9): error MSB3073: The command ""E:\TeamCity-BuildAgent\work\62023563850993a7\Web.nuget\nuget.exe" install "E:\TeamCity-BuildAgent\work\62023563850993a7\CompanyImagesMvc.Tests\packages.config" -source "" -RequireConsent -solutionDir "E:\TeamCity-BuildAgent\work\62023563850993a7\Web\ "" exited with code 1.

Possibly its able to run NuGet and connect to the feed and not find the version (its there) or its not running because the RequireConsent option is in the command line.

Does TeamCity construct this command line or MSBuild? How can I make it so it doesn't require consent?

Luke

2

2 Answers

3
votes

Turns out that once I'd enabled/setup the custom NuGet feed path, see link:

NuGet Package Restore cannot find package, has no Source

it all worked, the RequireConsent was a red-herring.

0
votes

That command line looks like it is being output from MSBuild when your solution is being built.

One way to enable package restore in TeamCity is to create an env.EnableNuGetPackageRestore environment variable and set its value to True. You can set that in the Build Parameters for your Team City project.