NuGetRestore@1 - NuGet Restore v1 task

Use this task to restore NuGet packages in preparation for a Visual Studio Build step.

Important

This task is deprecated. Builds that use it will break on 11-27-2023. Please switch to using NuGetCommand@2's restore option as soon as possible. For more information, see Migrate from NuGetInstaller@0 or NuGetRestore@1.

Use this task to restore NuGet packages in preparation for a Visual Studio Build step.

Use this task to restore NuGet packages in preparation for a Visual Studio Build step.

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.

Inputs

solution - Path to solution, packages.config, or project.json
string. Required. Default value: **/*.sln.

The path to the solution, packages.config, or project.json file that references the packages to be restored.


selectOrConfig - Feeds to use
string. Required. Allowed values: select (Feed(s) I select here), config (Feeds in my NuGet.config). Default value: select.

Specifies the feed(s) to use. Specify one feed from VSTS and/or NuGet.org using the select value. Specify multiple feeds by committing a nuget.config file to your source code repository and setting its path with the config value.


feed - Use packages from this Azure Artifacts feed
string. Optional. Use when selectOrConfig = select.

Includes the specified VSTS feed in the generated NuGet.config file.


feed - Use packages from this VSTS feed
string. Optional. Use when selectOrConfig = select.

Includes the specified VSTS feed in the generated NuGet.config file.


includeNuGetOrg - Use packages from NuGet.org
boolean. Optional. Use when selectOrConfig = select. Default value: true.

Includes the specified NuGet.org feed in the generated NuGet.config.


nugetConfigPath - Path to NuGet.config
string. Optional. Use when selectOrConfig = config.

Specifies the path to the NuGet.config in your repository that specifies the feeds from which to restore packages.


noCache - Disable local cache
boolean. Default value: false.

Prevents NuGet from using packages from local machine caches. Equivalent to the -NoCache NuGet.exe command line argument.


packagesDirectory - Destination directory
string.

Specifies the folder in which packages are installed. If no folder is specified, packages are restored into a packages/ folder alongside the selected solution, packages.config, or project.json. Equivalent to the -PackagesDirectory NuGet.exe command line argument.


verbosity - Verbosity
string. Allowed values: -, Quiet, Normal, Detailed. Default value: Detailed.

Specifies the amount of detail displayed in the output.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 2.144.0 or greater
Task category Package
Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 2.115.0 or greater
Task category Package