在Azure Pipelines中运行DotNetCoreCLI的预发行版本

时间:2019-12-24 02:43:29

标签: azure-devops yaml version azure-pipelines dotnetcorecli

编写Azure Pipelines yaml脚本时是否可以运行DotNetCoreCLI任务的预发行版本?我想尽可能使用3.0.1xx来利用dotnet tool update installing the tool rather than throwing an error if not installed

如果可能的话,使用预发行版本而不是版本2进行这样的调用的语法是什么?

- task: DotNetCoreCLI@2
  continueOnError: true
  inputs:
    command: custom
    custom: tool
    arguments: install -g coverlet.console
  displayName: Install Coverlet tool. This task will continue on error if coverlet is already installed.

1 个答案:

答案 0 :(得分:0)

您可以使用以下内容:

steps:
- task: UseDotNet@2
  displayName: 'Use .NET Core sdk'
  inputs:
    packageType: sdk
    version: 3.0.101
    installationPath: $(Agent.ToolsDirectory)/dotnet

可能的版本:https://github.com/dotnet/core/blob/master/release-notes/releases-index.json

阅读:https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer?view=azure-devops