无法在 Azure DevOps 管道中安装特定版本的 dotnet 工具

问题描述 投票:0回答:1

我正在尝试安装 dotnet 工具的一个版本,它适用于旧版本,但对于最新版本,由于某种原因,它无法安装

dotnet new tool-manifest
dotnet tool install foo --version 2.0.0 // this doesn't work
dotnet tool install foo --version 1.1.1 // this works, same feed both hosted on Azure DevOps Artifacts

存储库中存在相同的 nuget.config 文件。唯一的区别是版本号。我可以确认我们的 Artifacts 上存在这两个版本。

error NU1301: Unable to load the service index for source '...'
The tool package couild not be restored.
Tool 'foo' failed to install. This failure may have been caused by:

* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET Core tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.
azure-devops nuget-package dotnet-tool
1个回答
0
投票

我发现了这个问题。由于这是不在同一组织中的不同源,因此我在 Azure DevOps 中创建了一个服务连接来连接到此源。看起来 PAT 可能已被破坏(可能被意外删除或范围错误?)。我生成了一个新令牌并使用它,它解决了问题。我相信旧版本工作的原因是因为 Azure DevOps 自托管构建代理已经缓存了该工具。

© www.soinside.com 2019 - 2024. All rights reserved.