Use .NET Core task
Azure DevOps Services | Azure DevOps Server 2020 | Azure DevOps Server 2019
Use this task 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.
What's New
Support for installing multiple versions side by side.
Support for patterns in version to fetch latest in minor/major version. For example, you can now specify 3.1.x to get the latest patch.
Perform Multi-level lookup. This input is only applicable to Windows based agents. It configures the .NET Core's host process behavior for looking for a suitable shared framework on the machine. For more information, see Multi-level SharedFX Lookup.
Installs NuGet version 4.4.1 and sets up proxy configuration if present in NuGet config.
Task Inputs
Parameters | Description |
---|---|
packageType Package to install | Please select whether to install only runtime or SDK Default value: sdk |
useGlobalJson Use global json | Select this option to install all SDKs from global.json files. These files are searched from system.DefaultWorkingDirectory. You can change the search root path by setting working directory input |
workingDirectory Working Directory | Specify path from where global.json files should be searched when using `Use global json`. If empty, system.DefaultWorkingDirectory will be considered as the root path |
version Version | Specify version of .NET Core SDK or runtime to install. Versions can be given in the following formats 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 3.1 version is https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/3.1/releases.json |
includePreviewVersions Include Preview Versions | Select if you want preview versions to be included while searching for latest versions, such as while searching 3.1.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. 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. The default global locations are: For Windows: C:/Program Files/dotnet (64-bit processes) C:/Program Files (x86)/dotnet (32-bit process) |
This YAML example installs version 3.1.402 of .NET Core.
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 3.1.402
installationPath: $(Agent.ToolsDirectory)/dotnet
Open source
This task is open source on GitHub. Feedback and contributions are welcome.
Feedback
Submit and view feedback for