[英]Unable to find NuGet package version in TFS build?
I am using TFS 2017 and NuGet Installer - 0 task for NuGet restore in build definition but getting an error unable to find version .我正在使用 TFS 2017 和 NuGet 安装程序 - NuGet 的 0 任务在构建定义中恢复,但出现错误,无法找到版本。
It's using below command for restoring packages它使用下面的命令来恢复包
D:\agent\_work\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe restore -NonInteractive D:\agent\_work\42\s\xyz\xyz.sln -Verbosity Detailed
Unable to find version '3.2.7' of package 'Microsoft.AspNet.WebPages'.
2020-06-15T14:50:36.6499535Z Unable to find version '5.2.7' of package 'Microsoft.AspNet.WebApi.WebHost'.
2020-06-15T14:50:36.6499535Z Unable to find version '5.2.7' of package 'Microsoft.AspNet.WebApi.Core'.
2020-06-15T14:50:36.6499535Z Unable to find version '5.2.7' of package 'Microsoft.AspNet.WebApi.Client'.
2020-06-15T14:50:36.6499535Z Unable to find version '5.2.7' of package 'Microsoft.AspNet.Mvc'.
But when I run same above command manually on the agent it's working fine also tried updating NuGet task version.但是,当我在代理上手动运行相同的上述命令时,它工作正常也尝试更新 NuGet 任务版本。
Unable to find version '3.2.7' of package xxx
找不到 package xxx 的版本“3.2.7”
Agree with Etienne.同意艾蒂安。 The versions of these packages can be found in
nuget.org
.这些包的版本可以在
nuget.org
中找到。
When you use the Nuget Restore task
in TFS2017, you could try the following methods to use the nuget.org.当您在 TFS2017 中使用
Nuget Restore task
时,您可以尝试以下方法来使用 nuget.org。
Nuget Restore task
V1.Nuget Restore task
V1。 Select the Use Packages from nuget.org
option. Use Packages from nuget.org
。 If you use the nuget.config file, you could add the nuget.config
package source in the file.如果您使用 nuget.config 文件,您可以在文件中添加
nuget.config
package 源。
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <clear /> <add key="nuget.org" value="https://api.nuget.org/v3/index.json"protocolVersion="3" /> </packageSources> </configuration>
Here is a doc about nuget.config file .这是关于nuget.config 文件的文档。
Hope this helps.希望这可以帮助。
We had the same problem on one of our projects since this morning (16 June 2020) and we needed to upgrade our Nuget.exe.自今天早上(2020 年 6 月 16 日)以来,我们的一个项目遇到了同样的问题,我们需要升级 Nuget.exe。 I can see you're using Nuget 3.3 and the current recommended version is 5.5.1.
我可以看到您使用的是 Nuget 3.3,当前推荐的版本是 5.5.1。
It seems to be installed by a npm package.它似乎是由 npm package 安装的。
D:\agent\_work\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe
The latest version is here: https://www.nuget.org/downloads最新版本在这里: https://www.nuget.org/downloads
Replacing it with the latest stable version worked.用最新的稳定版本替换它是可行的。
EDIT: The reason old Nuget versions no longer works is because GitHub dropped support for TLS 1.0 and 1.1.编辑:旧的 Nuget 版本不再有效的原因是因为 GitHub 放弃了对 TLS 1.0 和 1.1 的支持。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.