Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (39 sloc) 4.77 KB
title description ms.prod ms.technology ms.topic ms.assetid ms.manager ms.author author ms.date monikerRange
Use .NET Core task
Acquires a specific version of .NET Core from the internet or the tools cache and adds it to the PATH
devops
devops-cicd
reference
B0CE7256-7898-45D3-9CB5-176B752BFEA6
jillfra
puagarw
pulkitaggarwl
5/2/2019
azure-devops

Use .NET Core task

Azure Pipelines

Use this task in a build or release pipeline to acquire a specific version of .NET Core from the Internet or the tools cache and add it to the PATH.

You can also use this task to change the version of .NET Core used in subsequent tasks like .NET Core cli task.

One other reason to use tool installer is if you want to decouple your pipeline from our update cycles to help avoid a pipeline run being broken due to a change we make to our agent software.

Task Inputs

ParametersDescription
packageType
Package to install
Please select whether to install only runtime or SDK
Default value: sdk
version
Version
Specify version of .NET Core SDK or runtime to install.
Versions can be given in the following formats
  • 2.x => Install latest in major version.
  • 2.2.x => Install latest in major and minor version
  • 2.2.104 => Install exact version

  • Find the value of version for installing SDK/Runtime, from the releases.json. The link to releases.json of that major.minor version can be found in releases-index file.. Like link to releases.json for 2.2 version is https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.2/releases.json
    includePreviewVersions
    Include Preview Versions
    Select if you want preview versions to be included while searching for latest versions, such as while searching 2.2.x. This setting is ignored if you specify an exact version, such as: 3.0.100-preview3-010431
    Default value: false
    installationPath
    Path To Install .NET Core
    Specify where .NET Core SDK/Runtime should be installed. Different paths can have the following impact on .Net's behavior.
  • $(Agent.ToolsDirectory): This makes the version to be cached on the agent since this directory is not cleanup up across pipelines. All pipelines running on the agent, would have access to the versions installed previously using the agent.
  • $(Agent.TempDirectory): This can ensure that a pipeline doesn't use any cached version of .NET core since this folder is cleaned up after each pipeline.
  • Any other path: You can configure any other path given the agent process has access to the path. This will change the state of the machine and impact all processes running on it.
    Note that you can also configure Multi-Level Lookup setting which can configure .NET host's probing for a suitable version.
    Default value: $(Agent.ToolsDirectory)/dotnet
  • performMultiLevelLookup
    Perform Multi Level Lookup
    This input is only applicable to Windows based agents. This configures the behavior of .NET host process for looking up a suitable shared framework.
  • false: (default) Only versions present in the folder specified in this task would be looked by the host process.
  • true: The host will attempt to look in pre-defined global locations using multi-level lookup.
    The default global locations are:
    For Windows:
    C:/Program Files/dotnet (64-bit processes)
    C:/Program Files (x86)/dotnet (32-bit process)
  • You can read more about it HERE

    This YAML example installs version 2.2.203 of .NET Core.

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

    Open source

    This task is open source on GitHub. Feedback and contributions are welcome.

    You can’t perform that action at this time.