Muokkaa

Jaa


NuGetToolInstaller@1 - NuGet tool installer v1 task

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.

Syntax

# NuGet tool installer v1
# 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@1
  inputs:
  # Advanced
    #versionSpec: # string. Version of NuGet.exe to install. 
    #checkLatest: false # boolean. Always check for new versions. 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.


checkLatest - Always check for new versions
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

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.

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

See also

For an explanation of tool installers and examples, see Tool installers.