简体   繁体   English

TeamCity - Nuget包恢复和RequireConsent

[英]TeamCity - Nuget package restore and RequireConsent

A TeamCity build fails. TeamCity构建失败。 It is failing to update a NuGet package to a particular version, which is available on a feed actually provided by TeamCity itself. 它无法将NuGet包更新为特定版本,该版本可在TeamCity本身实际提供的Feed中使用。

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):无法找到“MarkLogicManager40”软件包的版本“1.0.17.0”。

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. E:\\ TeamCity-BuildAgent \\ work \\ 62023563850993a7 \\ Web.nuget \\ nuget.targets(88,9):错误MSB3073:命令“”E:\\ TeamCity-BuildAgent \\ work \\ 62023563850993a7 \\ Web.nuget \\ nuget.exe“安装“E:\\ TeamCity-BuildAgent \\ work \\ 62023563850993a7 \\ CompanyImagesMvc.Tests \\ packages.config”-source“”-RequireConsent -solutionDir“E:\\ TeamCity-BuildAgent \\ work \\ 62023563850993a7 \\ Web \\”“退出代码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. 可能它能够运行NuGet并连接到feed并且找不到版本(它在那里)或者它没有运行,因为RequireConsent选项在命令行中。

Does TeamCity construct this command line or MSBuild? TeamCity是构造此命令行还是MSBuild? How can I make it so it doesn't require consent? 我怎样才能这样做而不需要同意?

Luke 卢克

Turns out that once I'd enabled/setup the custom NuGet feed path, see link: 事实证明,一旦我启用/设置自定义NuGet供稿路径,请参阅链接:

NuGet Package Restore cannot find package, has no Source NuGet Package Restore找不到包,没有Source

it all worked, the RequireConsent was a red-herring. 这一切都奏效了,RequireConsent是一个红鲱鱼。

That command line looks like it is being output from MSBuild when your solution is being built. 在构建解决方案时,该命令行看起来像是从MSBuild输出的。

One way to enable package restore in TeamCity is to create an env.EnableNuGetPackageRestore environment variable and set its value to True. 在TeamCity中启用程序包还原的一种方法是创建env.EnableNuGetPackageRestore环境变量并将其值设置为True。 You can set that in the Build Parameters for your Team City project. 您可以在Team City项目的Build Parameters中设置它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM