Nuget通过构建服务器恢复"无法找到版本"

Chr*_*ken 35 c# teamcity nuget

我有一个VS解决方案,作为TeamCity Build的一部分,我们从私有NuGet提要(myget)和公共提要(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
Run Code Online (Sandbox Code Playgroud)

Teamcity配置: 在此输入图像描述

rar*_*rrr 38

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

  • 或者升级 nuget.exe,它会默认使用新的 URL。 (2认同)
  • 我在使用带有_old_版本的`NuGet.exe`的_new_私有NuGet提要时遇到了问题.要解决这个问题,请打开一个命令提示符,`cd`到你的`.nuget`文件夹,然后运行`.\ NuGet.exe update -self`. (2认同)