0

我正在尝试运行“dotnet tool install”以在我的管道中的构建代理上安装 cli 工具,但行为不一致。有时它会成功执行命令,但有时也会失败并出现以下错误,我无法弄清楚为什么当我使用 azure 默认管道而不是基于 YAML 时,相同的步骤会成功执行。

error NU1212: Invalid project-package combination for project 1.0.0. DotnetToolReference project style can only contain references of the DotnetTool type  The tool package could not be restored. Tool 'project' 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.

这是任务:

- task: DotNetCoreCLI@2
  displayName: 'Install project'
  inputs:
    command: custom
    custom: tool
    arguments: 'install -g --version 1.0.0 --add-source https://sample.jfrog.io/artifactory/project project'

命令:

dotnet tool install -g --version 1.0.0 --add-source https://sample.jfrog.io/artifactory/project project

这些任务在 Microsoft 托管代理上的 Windows 最新映像上运行

4

0 回答 0