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.
输入
要安装的 versionSpec
- 版本的 NuGet.exe
string
。
一个版本或版本范围,指定要在路径上可用的 NuGet 版本。 使用 x 作为通配符。 请参阅可用 NuGet 版本的 列表。
如果要匹配预发行版本,该规范必须包含上面列表中的主版本、次要版本、修补程序和预发行版本。 如果未指定版本,将自动选择一个版本。
示例:4.x
、3.3.x
、2.8.6
、>=4.0.0-0
。
checkLatest
-
始终下载最新的匹配版本
boolean
。 默认值:false
。
当此布尔值设置为 true
时,该任务始终检查并下载满足版本规范的最新可用版本的 NuGet.exe
。即使已缓存所选版本的 NuGet,此选项也始终会产生下载时间。
当新版本的 NuGet 发布时,启用此选项可能会导致意外的生成中断。
小提示
如果使用 Microsoft托管代理,则应将此设置为 false。 Microsoft定期更新Microsoft托管的代理,但它们通常略落后于最新版本。 启用此参数可能会导致生成花费大量时间更新到较新的次要版本。
任务控制选项
除任务输入之外,所有任务都具有控制选项。 有关详细信息,请参阅 控件选项和常见任务属性。
输出变量
没有。
注解
NuGetToolInstaller@1提供了此任务的较新版本。