NuGetToolInstaller@0 - NuGet 工具安裝程式 v0 工作

使用此工作來尋找、下載和快取指定的 NuGet 版本,並將其新增至 PATH。 如需工具快取的相關資訊,請參閱 azure-pipelines-tool-lib 存放庫

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.

輸入

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

版本或版本範圍,指定要在路徑上使用的 NuGet 版本。 使用 x 做為萬用字元。 請參閱 可用的 NuGet 版本清單

如果您想要符合發行前版本,規格必須包含上述清單的主要、次要、修補程式和發行前版本。 如果未指定版本,則會自動選擇版本。

範例: 4.x 、、 3.3.x>=4.0.0-02.8.6


versionSpec - 要安裝的 NuGet.exe 版本
string. 必要。 預設值:4.3.0

版本或版本範圍,指定要在路徑上使用的 NuGet 版本。 使用 x 做為萬用字元。 請參閱 可用的 NuGet 版本清單

如果您想要符合發行前版本,規格必須包含上述清單的主要、次要、修補程式和發行前版本。 如果未指定版本,則會自動選擇版本。

範例: 4.x 、、 3.3.x>=4.0.0-02.8.6


checkLatest - 一律下載最新的比對版本
boolean. 預設值:false

當這個布林值設定為 true 時,工作一律會檢查並下載符合版本規格的最新可用版本 NuGet.exe 。即使已快取選取的 NuGet 版本,此選項也一律會產生下載時間。

當新版本的 NuGet 發行時,啟用此選項可能會導致非預期的組建中斷。

提示

如果您使用 Microsoft 裝載的代理程式,您應該將此設定保留為 false。 Microsoft 會定期更新 Microsoft 裝載的代理程式,但它們通常稍晚于最新版本。 啟用此參數可能會導致您的組建花費大量時間更新為較新的次要版本。


工作控制選項

除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制選項和一般工作屬性

輸出變數

無。

備註

此工作有較新版本可在 NuGetToolInstaller@1使用。

規格需求

需求 描述
管線類型 YAML、傳統組建、傳統版本
在 上執行 Agent、DeploymentGroup
要求
Capabilities 執行這項工作 可滿足相同作業 中任何後續工作的需求:NuGet
命令限制 任何
可設定變數 任何
代理程式版本 2.144.0 或更新版本
工作類別 工具
需求 描述
管線類型 YAML、傳統組建、傳統版本
在 上執行 Agent、DeploymentGroup
要求
Capabilities 執行這項工作 可滿足相同作業 中任何後續工作的需求:NuGet
命令限制 任何
可設定變數 任何
代理程式版本 2.115.0 或更新版本
工作類別 工具