YAML 管道与默认 Azure 管道中的输出不一致

问题描述

我正在尝试运行“dotnet 工具安装”以在我的管道中的构建代理上安装 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 最新映像上运行

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)