DotNetCoreInstaller@1 - .NET Core SDK/runtime installer v1 task

Use this task to acquire a specific version of the .NET Core SDK from the internet or local cache and add it to the PATH.

Important

This task is deprecated and will be retired January 31, 2024. Use UseDotNet@2.

Use this task to acquire a specific version of the .NET Core SDK from the internet or local cache and add it to the PATH.

Important

TThis task is deprecated. Use @UseDotNet2.

Acquires a specific version of the .NET Core SDK from the internet or local cache and adds it to the PATH.

Syntax

# .NET Core SDK/runtime installer v1
# Acquire a specific version of the .NET Core SDK from the internet or local cache and add it to the PATH.
- task: DotNetCoreInstaller@1
  inputs:
    packageType: 'sdk' # 'runtime' | 'sdk'. Required. Package to install. Default: sdk.
    version: '2.2.x' # string. Required. Version. Default: 2.2.x.
    #includePreviewVersions: false # boolean. Include Preview Versions. Default: false.
  # Advanced
    #installationPath: '$(Agent.ToolsDirectory)/dotnet' # string. Path To Install .Net Core. Default: $(Agent.ToolsDirectory)/dotnet.
    #performMultiLevelLookup: false # boolean. Perform Multi Level Lookup. Default: false.

Inputs

packageType - Package to install
string. Required. Allowed values: runtime (Only Runtime), sdk (SDK (contains runtime)). Default value: sdk.

Specifies whether to install only Runtime or the full SDK.


version - Version
string. Required. Default value: 2.2.x.

Specifies the version of .NET Core SDK or Runtime to install.

Use the following format to specify the version:

  • 2.x: Installs the latest in major version.
  • 2.2.x: Installs the latest in major and minor version.
  • 2.2.104: Installs the exact version.

Find the value of version for installing SDK/Runtime in the releases-index file.


includePreviewVersions - Include Preview Versions
boolean. Default value: false.

Specifies if you want preview versions to be included while searching for latest versions. This setting is ignored if you specify an exact version, such as 3.0.100-preview3-010431.


installationPath - Path To Install .Net Core
string. Default value: $(Agent.ToolsDirectory)/dotnet.

Specifies where .NET Core SDK/Runtime should be installed. Different paths can have the following impact on .NET's behavior:

  • $(Agent.ToolsDirectory): This determines the version to be cached on the agent since this directory isn't cleaned 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.

You can also configure the Multi-Level Lookup setting. This setting can configure .NET host to probe for a suitable version.


performMultiLevelLookup - Perform Multi Level Lookup
boolean. Default value: false.

This input is only applicable to Windows-based agents. This input configures the behavior of .NET host processes for looking up a suitable shared framework. False means that only versions present in the folder specified in this task would be looked by the host process. True means that the host will attempt to look in pre-defined global locations using Multi-level Lookup.

For Windows, the default global locations are:

  • C:\Program Files\dotnet (64-bit processes)
  • C:\Program Files (x86)\dotnet (32-bit process)

For more information, see Multi-level SharedFX Lookup.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Remarks

This task is deprecated. Use @UseDotNet2.

What's new in this task version.

  • Support for installing multiple versions side by side.
  • Support for patterns in version to fetch latest in minor/major version.
  • Restrict Multi-level lookup.

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities Running this task satisfies the following demands for any subsequent tasks in the same job: DotNetCore
Command restrictions Any
Settable variables Any
Agent version All supported agent versions.
Task category Tool