NuGetRestore@1 - NuGet 还原 v1 任务

使用此任务还原 NuGet 包,为 Visual Studio 生成步骤做准备。

重要

此任务已弃用。 使用它的内部版本将在 2023 年 11 月 27 日中断。 请尽快切换到使用 NuGetCommand@2restore 选项。 有关详细信息,请参阅 从 NuGetInstaller@0 或 NuGetRestore@1 迁移

使用此任务还原 NuGet 包,为 Visual Studio 生成步骤做准备。

使用此任务还原 NuGet 包,为 Visual Studio 生成步骤做准备。

语法

# 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 - 解决方案、packages.config 或project.json的路径
string. 必需。 默认值:**/*.sln

引用要还原的包的解决方案、 packages.configproject.json 文件的路径。


selectOrConfig - 要使用的源
string. 必需。 允许的值: select (源 () 我在此处选择) , config (NuGet.config) 中的源。 默认值:select

指定要使用的源 () 。 使用 值指定来自 VSTS 和/或 NuGet.org 的 select 一个源。 通过将文件提交 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. 允许的值: -QuietNormalDetailed。 默认值:Detailed

指定在输出中显示的详细信息量。


任务控制选项

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

输出变量

无。

要求

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