azure-devopsyamlversionazure-pipelinesdotnetcorecli

Run a prerelease version of DotNetCoreCLI in Azure Pipelines


Is it possible to run a pre-release version of the DotNetCoreCLI task when writing an Azure Pipelines yaml script? I would like to use 3.0.1xx if possible to take advantage of dotnet tool update installing the tool rather than throwing an error if not installed.

If it is possible, what would the syntax be to make a call like this use a prerelease version rather than version 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.

Solution

  • you could use the following:

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

    possible versions: https://github.com/dotnet/core/blob/master/release-notes/releases-index.json

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