c# - 通过构建服务器 "unable to find version"进行 Nuget 还原

标签 c# nuget teamcity

我有一个 VS 解决方案,作为 TeamCity 构建的一部分,我们从私有(private) NuGet 源 (myget) 和公共(public)源 (nuget.org) 恢复包。大多数包恢复正常,但它卡在下面的 WebApi 和 Mono.Security 上。这一切都在 Visual Studio 中本地工作。

[restore] NuGet command: C:\TeamCity\buildAgent\plugins\nuget-agent\bin\JetBrains.TeamCity.NuGetRunner.exe C:\TeamCity\buildAgent\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe restore C:\TeamCity\buildAgent\work\953bd084b49f7d88\DataFinch.Web.sln -Source https://www.myget.org/F/datafinch/auth/<hidden>/api/v2 -Source https://api.nuget.org/v3/index.json
[11:41:35][restore] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script473789219385667038.cmd
[11:41:35][restore] in directory: C:\TeamCity\buildAgent\work\953bd084b49f7d88
[11:41:35][restore] JetBrains TeamCity NuGet Runner 8.0.37059.9
[11:41:35][restore] Registered additional extensions from paths: C:\TeamCity\buildAgent\plugins\nuget-agent\bin\plugins-2.8
[11:41:35][restore] Starting NuGet.exe 2.8.50926.602 from C:\TeamCity\buildAgent\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe
[11:41:43][restore] Unable to find version '5.2.3' of package 'Microsoft.AspNet.WebApi.Client'.
[11:41:43][restore] Unable to find version '5.2.3' of package 'Microsoft.AspNet.WebApi.Core'.
[11:41:43][restore] Unable to find version '3.2.3.0' of package 'Mono.Security'.
[11:41:43][restore] Unable to find version '6.0.4' of package 'Newtonsoft.Json'.
[11:41:43][restore] Process exited with code 1

Teamcity 配置: enter image description here

最佳答案

尝试使用 https://www.nuget.org/api/v2 而不是 https://api.nuget.org/v3/index.json nuget 文档:https://docs.nuget.org/consume/Command-Line-Reference .

关于c# - 通过构建服务器 "unable to find version"进行 Nuget 还原,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32360518/

相关文章:

C# XML 序列化/反序列化

C# WPF 应用程序在由使用 topshelf 创建的 Windows 服务启动时不显示表单

c# - 如果没有为 AlertDialog 分配资源 ID,它是否会有资源 ID?

c# - 如何以编程方式安装 NuGet 包?

c# - 在 Team City 上构建时,命名空间 'System.Data.Entity' 中不存在“验证”

c# - 不区分大小写与流畅验证的比较

visual-studio-2013 - 控制台上的 Visual Studio 2013/15 Nuget 错误 - "The module to process ' nuget.psm 1', listed in field ' ModuleToProcess' of module manifest..."

c# - 项目设置中缺少 Visual Studio 2017 包选项卡

build - 如果找不到工件,如何使 TeamCity 构建失败?

svn - Teamcity - 最后提交作者和评论 - 传递到 ant 脚本