Редактиране

Споделяне чрез


NuGetToolInstaller@0 - NuGet tool installer v0 task

Use this task to find, download, and cache a specified version of NuGet and add it to the PATH. For information on the tools cache, see the azure-pipelines-tool-lib repo.

Syntax

# NuGet tool installer v0
# Acquires a specific version of NuGet from the internet or the tools cache and adds it to the PATH. Use this task to change the version of NuGet used in the NuGet tasks.
- task: NuGetToolInstaller@0
  inputs:
    #versionSpec: # string. Version of NuGet.exe to install. 
    #checkLatest: false # boolean. Always download the latest matching version. Default: false.
# NuGet tool installer v0
# Acquires a specific version of NuGet from the internet or the tools cache and adds it to the PATH. Use this task to change the version of NuGet used in the NuGet tasks.
- task: NuGetToolInstaller@0
  inputs:
    versionSpec: '4.3.0' # string. Required. Version of NuGet.exe to install. Default: 4.3.0.
    #checkLatest: false # boolean. Always download the latest matching version. Default: false.
# NuGet Tool Installer v0
# Acquires a specific version of NuGet from the internet or the tools cache and adds it to the PATH. Use this task to change the version of NuGet used in the NuGet tasks.
- task: NuGetToolInstaller@0
  inputs:
    versionSpec: '4.3.0' # string. Required. Version of NuGet.exe to install. Default: 4.3.0.
    #checkLatest: false # boolean. Always download the latest matching version. Default: false.

Inputs

versionSpec - Version of NuGet.exe to install
string.

A version or version range that specifies the NuGet version to make available on the path. Use x as a wildcard. See the list of available NuGet versions.

If you want to match a pre-release version, the specification must contain a major, minor, patch, and pre-release version from the list above. If a version isn't specified, then one will be chosen automatically.

Examples: 4.x, 3.3.x, 2.8.6, >=4.0.0-0.


versionSpec - Version of NuGet.exe to install
string. Required. Default value: 4.3.0.

A version or version range that specifies the NuGet version to make available on the path. Use x as a wildcard. See the list of available NuGet versions.

If you want to match a pre-release version, the specification must contain a major, minor, patch, and pre-release version from the list above. If a version isn't specified, then one will be chosen automatically.

Examples: 4.x, 3.3.x, 2.8.6, >=4.0.0-0.


checkLatest - Always download the latest matching version
boolean. Default value: false.

When this boolean is set to true, the task always checks for and downloads the latest available version of NuGet.exe that satisfies the version spec. This option will also always incur download time, even if the selected version of NuGet is already cached.

Enabling this option could cause unexpected build breaks when a new version of NuGet is released.

Tip

If you're using the Microsoft-hosted agents, you should leave this set to false. Microsoft updates the Microsoft-hosted agents on a regular basis, but they're often slightly behind the latest version. Enabling this parameter could result in your build spending a lot of time updating to a newer minor version.


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

There is a newer version of this task available at NuGetToolInstaller@1.

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: NuGet
Command restrictions Any
Settable variables Any
Agent version 2.144.0 or greater
Task category Tool
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: NuGet
Command restrictions Any
Settable variables Any
Agent version 2.115.0 or greater
Task category Tool