NuGetRestore@1 - NuGet 還原 v1 工作
使用此工作來還原 NuGet 套件,以準備 Visual Studio 建置步驟。
重要
此工作已被取代。 使用它的組建會在 11-27-2023 中斷。 請儘快切換到使用 NuGetCommand@2選項 restore
。 如需詳細資訊,請參閱 從NuGetInstaller@0移轉或NuGetRestore@1。
使用此工作來還原 NuGet 套件,以準備 Visual Studio 建置步驟。
Syntax
# NuGet Restore v1
# Restores NuGet packages in preparation for a Visual Studio Build step.
- task: NuGetRestore@1
inputs:
solution: '**/*.sln' # string. Required. Path to solution, packages.config, or project.json. Default: **/*.sln.
selectOrConfig: 'select' # 'select' | 'config'. Required. Feeds to use. Default: select.
#feed: # string. Optional. Use when selectOrConfig = select. Use packages from this Azure Artifacts feed.
#includeNuGetOrg: true # boolean. Optional. Use when selectOrConfig = select. Use packages from NuGet.org. Default: true.
#nugetConfigPath: # string. Optional. Use when selectOrConfig = config. Path to NuGet.config.
# Advanced
#noCache: false # boolean. Disable local cache. Default: false.
#packagesDirectory: # string. Destination directory.
#verbosity: 'Detailed' # '-' | 'Quiet' | 'Normal' | 'Detailed'. Verbosity. Default: Detailed.
# NuGet Restore v1
# Restores NuGet packages in preparation for a Visual Studio Build step.
- task: NuGetRestore@1
inputs:
solution: '**/*.sln' # string. Required. Path to solution, packages.config, or project.json. Default: **/*.sln.
selectOrConfig: 'select' # 'select' | 'config'. Required. Feeds to use. Default: select.
#feed: # string. Optional. Use when selectOrConfig = select. Use packages from this VSTS feed.
#includeNuGetOrg: true # boolean. Optional. Use when selectOrConfig = select. Use packages from NuGet.org. Default: true.
#nugetConfigPath: # string. Optional. Use when selectOrConfig = config. Path to NuGet.config.
# Advanced
#noCache: false # boolean. Disable local cache. Default: false.
#packagesDirectory: # string. Destination directory.
#verbosity: 'Detailed' # '-' | 'Quiet' | 'Normal' | 'Detailed'. Verbosity. Default: Detailed.
輸入
solution
- solution、packages.config 或 project.json 的路徑
string
. 必要。 預設值:**/*.sln
。
參考要還原之封裝的方案、 packages.config
或 project.json
檔案路徑。
selectOrConfig
- 要使用的摘要
string
. 必要。 允許的值: select
(摘要 () 我在此選取) , config
(NuGet.config) 中的摘要。 預設值:select
。
指定要使用的摘要 () 。 使用 select
值,從 VSTS 和/或 NuGet.org 指定一個摘要。 藉 nuget.config
由將檔案認可至原始程式碼存放庫,並使用 值來設定其路徑 config
,以指定多個摘要。
feed
- 使用此 Azure Artifacts 摘要中的套件
string
. 選擇性。 使用 時機 selectOrConfig = select
。
在產生的 NuGet.config
檔案中包含指定的 VSTS 摘要。
feed
- 使用此 VSTS 摘要中的套件
string
. 選擇性。 使用 時機 selectOrConfig = select
。
在產生的 NuGet.config
檔案中包含指定的 VSTS 摘要。
includeNuGetOrg
- 使用來自 NuGet.org 的套件
boolean
. 選擇性。 使用 時機 selectOrConfig = select
。 預設值:true
。
在產生的 NuGet.config
中包含指定的 NuGet.org 摘要。
nugetConfigPath
- NuGet.config的路徑
string
. 選擇性。 使用 時機 selectOrConfig = config
。
指定存放庫中 的 路徑 NuGet.config
,指定要從中還原封裝的摘要。
noCache
- 停用本機快取
boolean
. 預設值:false
。
防止 NuGet 使用來自本機電腦快取的套件。 相當於 -NoCache NuGet.exe
命令列引數。
packagesDirectory
- 目的地目錄
string
.
指定安裝封裝的資料夾。 如果未指定任何資料夾,封裝會與選取的方案、 packages.config
或 project.json
一起還原到 packages/
資料夾。 相當於 -PackagesDirectory NuGet.exe
命令列引數。
verbosity
- 冗長
string
. 允許的值: -
、、 Quiet
Normal
、 Detailed
。 預設值:Detailed
。
指定輸出中顯示的詳細資料量。
工作控制選項
除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制項選項和一般工作屬性。
輸出變數
無。
規格需求
需求 | 描述 |
---|---|
管線類型 | YAML、傳統組建、傳統版本 |
執行于 | Agent、DeploymentGroup |
要求 | 無 |
Capabilities | 此工作不符合作業中後續工作的任何需求。 |
命令限制 | 任何 |
Settable 變數 | 任何 |
代理程式版本 | 2.144.0 或更新版本 |
工作類別 | 套件 |
需求 | 描述 |
---|---|
管線類型 | YAML、傳統組建、傳統版本 |
執行于 | Agent、DeploymentGroup |
要求 | 無 |
Capabilities | 此工作不符合作業中後續工作的任何需求。 |
命令限制 | 任何 |
Settable 變數 | 任何 |
代理程式版本 | 2.115.0 或更新版本 |
工作類別 | 套件 |
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應