0

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.
Ayb4btu
  • 3,208
  • 5
  • 30
  • 42
  • 1
    Does this answer your question? [Build .NET Core 3.0 on Azure Pipelines](https://stackoverflow.com/questions/56574113/build-net-core-3-0-on-azure-pipelines) – Shayki Abramczyk Dec 24 '19 at 06:40
  • I was thinking the cli task ran separately from the sdk version, but looking at that answer and the one given here they are linked. – Ayb4btu Dec 24 '19 at 08:01

1 Answers1

0

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

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
  • How does the `UseDotNet` and the `DotNetCoreInstaller` tasks differ? Does only `UseDotNet` change the version of the `DotNetCoreCLI` task? – Ayb4btu Dec 24 '19 at 04:20
  • where do you see the `DotNetCoreInstaller` task? you are using the `dotnetcorecli` task, which just invokes the `dotnet` with a specific command, whereas this command is needed before your command to install specific version of the cli – 4c74356b41 Dec 24 '19 at 06:15
  • I'm using the `DotNetCoreInstaller` task to install v2.2, so was wondering if it mattered for cli if either `DotNetCoreInstaller` or `UseDotNet` were used. – Ayb4btu Dec 24 '19 at 07:58