【问题标题】:NuGet cannot restore AutoMapper 5.1.1 on TeamCity 10NuGet 无法在 TeamCity 10 上恢复 AutoMapper 5.1.1
【发布时间】:2016-09-14 10:58:36
【问题描述】:

使用 NuGet 3.3.0 时,我们在恢复 AutoMapper 5.1.1 时收到以下错误。其他包恢复成功:

[11:49:53]  [restore] Unable to find version '5.1.1' of package 'AutoMapper'.
[11:49:53]  [restore] Process exited with code 1

我们遇到了一个问题,即我们无法在开发机器上的 Visual Studio 2013 中恢复此包,除非我们更新了 NuGet 包管理器。

如果我们在 TeamCity 服务器上的 Visual Studio 2013 中构建项目,则包恢复成功,这使我们认为需要更新的是构建代理上的 NuGet 版本。

我们尝试通过 TeamCity | 上传 NuGet.CommandLine.3.4.3.nupkg工具菜单,但是 TeamCity 抱怨它不是一个有效的 NuGet 包,因为它不包含 tools\NuGet.exe,即使它包含!

我们确实成功地上传了Nuget.CommandLine.3.6.0-beta1.1839.nupkg,但是当构建步骤尝试运行时,这给了我们一个不同的错误。

所以我们陷入了困境。有没有人遇到过这个问题并设法解决了?

【问题讨论】:

  • 如果您从 NuGet v2 更新到 NuGet v3,那么我猜想在全局 NuGet.Config 文件 %AppData%\NuGet\NuGet.Config 中没有定义包源。如果全局 NuGet.Config 文件不存在,NuGet v3 默认不定义 NuGet 包源。如果没有定义包源,NuGet v2 将默认添加 nuget.org。您可以全局定义一个,也可以在 Team City 中定义它,或者将您自己的 NuGet.Config 文件添加到您的存储库中。
  • @MattWard 我们已经成功使用 3.3.0 有一段时间了。源在 TeamCity 上的 NuGet 构建步骤中进一步列出 - 除 AutoMapper 外,所有其他包都成功恢复。
  • 是的,所以听起来像别的东西。
  • 通过使用 NuGet.CommandLine 3.5.0-beta-final 解决了这个问题。使用 beta 版本并不理想,但我会尝试寻找与 TeamCity 一起使用的完整版本。

标签: nuget teamcity automapper


【解决方案1】:

NuGet.CommandLine.3.5.0-beta-final.nupkg 上传到 TeamCity(管理 => 工具 => NuGet.exe => 添加版本)并将 NuGet 构建步骤设置为版本3.5.0-beta-final 成功解决了我们的问题。

我的包裹来自:https://dotnet.myget.org/feed/nuget-build/package/nuget/NuGet.CommandLine/3.5.0-beta-final

【讨论】:

  • 也为我工作过,现在才发布 3.5。
猜你喜欢
  • 1970-01-01
  • 2018-05-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-08-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多