NuGetToolInstaller@0 - NuGet 工具安装程序 v0 任务

使用此任务查找、下载和缓存指定版本的 NuGet ,并将其添加到 PATH。 有关工具缓存的信息,请参阅 azure-pipelines-tool-lib 存储库。

语法

# 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.

输入

versionSpec - 要安装的 NuGet.exe 版本
string.

一个版本或版本范围,指定要在路径上使用的 NuGet 版本。 使用 x 作为通配符。 请参阅 可用 NuGet 版本的列表

如果要匹配预发行版本,该规范必须包含上述列表中的主版本、次要版本、修补程序版本和预发行版本。 如果未指定版本,则会自动选择一个版本。

示例: 4.x3.3.x2.8.6>=4.0.0-0


versionSpec - 要安装的 NuGet.exe 版本
string. 必需。 默认值:4.3.0

一个版本或版本范围,指定要在路径上使用的 NuGet 版本。 使用 x 作为通配符。 请参阅 可用 NuGet 版本的列表

如果要匹配预发行版本,该规范必须包含上述列表中的主版本、次要版本、修补程序版本和预发行版本。 如果未指定版本,则会自动选择一个版本。

示例: 4.x3.3.x2.8.6>=4.0.0-0


checkLatest - 始终下载最新匹配版本
boolean. 默认值:false

当此布尔值设置为 true时,任务始终检查并下载满足版本规范的最新可用版本 NuGet.exe 。即使已缓存所选版本的 NuGet,此选项也始终会产生下载时间。

发布新版本的 NuGet 时,启用此选项可能会导致意外的生成中断。

提示

如果使用 Microsoft 托管的代理,则应将此设置保留为 false。 Microsoft 会定期更新 Microsoft 托管代理,但它们通常略落后于最新版本。 启用此参数可能会导致生成花费大量时间更新到较新的次要版本。


任务控制选项

除了任务输入,所有任务都有控制选项。 有关详细信息,请参阅 控制选项和常见任务属性

输出变量

无。

备注

NuGetToolInstaller@1中提供了此任务的较新版本。

要求

要求 说明
管道类型 YAML,经典内部版本,经典版本
运行平台 Agent、DeploymentGroup
需求
功能 运行此任务可满足同一作业中任何后续任务的以下 要求 :NuGet
命令限制 任意
可设置的变量 任意
代理版本 2.144.0 或更高版本
任务类别 工具
要求 说明
管道类型 YAML,经典内部版本,经典版本
运行平台 Agent、DeploymentGroup
需求
功能 运行此任务可满足同一作业中任何后续任务的以下 要求 :NuGet
命令限制 任意
可设置的变量 任意
代理版本 2.115.0 或更高版本
任务类别 工具