TeamCity - Nuget and RequireConsent Package Recovery

TeamCity build failed. It does not upgrade the NuGet package to a specific version available in the feed actually provided by TeamCity.

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

E: \ TeamCity-BuildAgent \ work \ 62023563850993a7 \ Web.nuget \ nuget.targets (88, 9): error MSB3073: 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.

Perhaps he will be able to run NuGet and connect to the feed, and not find the version (it is there) or it does not work, because the RequireConsent parameter is on the command line.

Does TeamCity create this command line or MSBuild? How can I do this so that he does not require consent?

Luke

+4
source share
2 answers

It turns out that as soon as I turned on / set the custom NuGet transfer path, see the link:

NuGet package recovery cannot find package, has no source

it all worked, RequireConsent was a red herring.

+3
source

This command line looks like it is being pulled from MSBuild when your solution is being built.

One way to enable package recovery in TeamCity is to create an env.EnableNuGetPackageRestore environment variable and set it to True. You can set this in the Build options for your Team City project.

0
source

Source: https://habr.com/ru/post/1486601/


All Articles