dotnet-installer/Documentation/manpages/sdk/dotnet-restore.1
2018-03-30 11:48:04 -04:00

198 lines
7.6 KiB
Groff

.\" Automatically generated by Pandoc 2.1.3
.\"
.TH "dotnet restore command \- .NET Core CLI" "1" "" "" ".NET Core"
.hy
.SH dotnet restore
.PP
.SH NAME
.PP
\f[C]dotnet\ restore\f[] \- Restores the dependencies and tools of a project.
.SH SYNOPSIS
.SS .NET Core 2.x
.IP
.nf
\f[C]
dotnet\ restore\ [<ROOT>]\ [\-\-configfile]\ [\-\-disable\-parallel]\ [\-\-force]\ [\-\-ignore\-failed\-sources]\ [\-\-no\-cache]\ [\-\-no\-dependencies]\ [\-\-packages]\ [\-r|\-\-runtime]\ [\-s|\-\-source]\ [\-v|\-\-verbosity]
dotnet\ restore\ [\-h|\-\-help]
\f[]
.fi
.SS .NET Core 1.x
.IP
.nf
\f[C]
dotnet\ restore\ [<ROOT>]\ [\-\-configfile]\ [\-\-disable\-parallel]\ [\-\-ignore\-failed\-sources]\ [\-\-no\-cache]\ [\-\-no\-dependencies]\ [\-\-packages]\ [\-r|\-\-runtime]\ [\-s|\-\-source]\ [\-v|\-\-verbosity]
dotnet\ restore\ [\-h|\-\-help]
\f[]
.fi
.PP
* * * * *
.SH DESCRIPTION
.PP
The \f[C]dotnet\ restore\f[] command uses NuGet to restore dependencies as well as project\-specific tools that are specified in the project file.
By default, the restoration of dependencies and tools are performed in parallel.
.PP
.PP
In order to restore the dependencies, NuGet needs the feeds where the packages are located.
Feeds are usually provided via the \f[I]NuGet.config\f[] configuration file.
A default configuration file is provided when the CLI tools are installed.
You specify additional feeds by creating your own \f[I]NuGet.config\f[] file in the project directory.
You also specify additional feeds per invocation at a command prompt.
.PP
For dependencies, you specify where the restored packages are placed during the restore operation using the \f[C]\-\-packages\f[] argument.
If not specified, the default NuGet package cache is used, which is found in the \f[C]\&.nuget/packages\f[] directory in the user's home directory on all operating systems (for example, \f[I]/home/user1\f[] on Linux or \f[I]C:1\f[] on Windows).
.PP
For project\-specific tooling, \f[C]dotnet\ restore\f[] first restores the package in which the tool is packed, and then proceeds to restore the tool's dependencies as specified in its project file.
.PP
The behavior of the \f[C]dotnet\ restore\f[] command is affected by some of the settings in the \f[I]Nuget.Config\f[] file, if present.
For example, setting the \f[C]globalPackagesFolder\f[] in \f[I]NuGet.Config\f[] places the restored NuGet packages in the specified folder.
This is an alternative to specifying the \f[C]\-\-packages\f[] option on the \f[C]dotnet\ restore\f[] command.
For more information, see the NuGet.Config reference.
.SS Implicit \f[C]dotnet\ restore\f[]
.PP
Starting with .NET Core 2.0, \f[C]dotnet\ restore\f[] is run implicitly if necessary when you issue the following commands:
.IP \[bu] 2
\f[C]dotnet\ new\f[]
.IP \[bu] 2
\f[C]dotnet\ build\f[]
.IP \[bu] 2
\f[C]dotnet\ run\f[]
.IP \[bu] 2
\f[C]dotnet\ test\f[]
.IP \[bu] 2
\f[C]dotnet\ publish\f[]
.IP \[bu] 2
\f[C]dotnet\ pack\f[]
.PP
In most cases, you no longer need to explicitly use the \f[C]dotnet\ restore\f[] command.
.PP
In some cases, it is inconvenient for \f[C]dotnet\ restore\f[] to run implicitly.
For example, some automated systems, such as build systems, need to call \f[C]dotnet\ restore\f[] explicitly to control when the restore occurs so that they can control network usage.
To prevent \f[C]dotnet\ restore\f[] from running implicitly, you can use the \f[C]\-\-no\-restore\f[] switch with any of these commands to disable implicit restore.
.SS Arguments
.PP
\f[C]ROOT\f[]
.PP
Optional path to the project file to restore.
.SH OPTIONS
.SS .NET Core 2.x
.PP
\f[C]\-\-configfile\ <FILE>\f[]
.PP
The NuGet configuration file (\f[I]NuGet.config\f[]) to use for the restore operation.
.PP
\f[C]\-\-disable\-parallel\f[]
.PP
Disables restoring multiple projects in parallel.
.PP
\f[C]\-\-force\f[]
.PP
Forces all dependencies to be resolved even if the last restore was successful.
This is equivalent to deleting the \f[I]project.assets.json\f[] file.
.PP
\f[C]\-h|\-\-help\f[]
.PP
Prints out a short help for the command.
.PP
\f[C]\-\-ignore\-failed\-sources\f[]
.PP
Only warn about failed sources if there are packages meeting the version requirement.
.PP
\f[C]\-\-no\-cache\f[]
.PP
Specifies to not cache packages and HTTP requests.
.PP
\f[C]\-\-no\-dependencies\f[]
.PP
When restoring a project with project\-to\-project (P2P) references, restores the root project and not the references.
.PP
\f[C]\-\-packages\ <PACKAGES_DIRECTORY>\f[]
.PP
Specifies the directory for restored packages.
.PP
\f[C]\-r|\-\-runtime\ <RUNTIME_IDENTIFIER>\f[]
.PP
Specifies a runtime for the package restore.
This is used to restore packages for runtimes not explicitly listed in the \f[C]<RuntimeIdentifiers>\f[] tag in the \f[I].csproj\f[] file.
For a list of Runtime Identifiers (RIDs), see the RID catalog.
Provide multiple RIDs by specifying this option multiple times.
.PP
\f[C]\-s|\-\-source\ <SOURCE>\f[]
.PP
Specifies a NuGet package source to use during the restore operation.
This overrides all of the sources specified in the \f[I]NuGet.config\f[] files.
Multiple sources can be provided by specifying this option multiple times.
.PP
\f[C]\-\-verbosity\ <LEVEL>\f[]
.PP
Sets the verbosity level of the command.
Allowed values are \f[C]q[uiet]\f[], \f[C]m[inimal]\f[], \f[C]n[ormal]\f[], \f[C]d[etailed]\f[], and \f[C]diag[nostic]\f[].
.SS .NET Core 1.x
.PP
\f[C]\-\-configfile\ <FILE>\f[]
.PP
The NuGet configuration file (\f[I]NuGet.config\f[]) to use for the restore operation.
.PP
\f[C]\-\-disable\-parallel\f[]
.PP
Disables restoring multiple projects in parallel.
.PP
\f[C]\-h|\-\-help\f[]
.PP
Prints out a short help for the command.
.PP
\f[C]\-\-ignore\-failed\-sources\f[]
.PP
Only warn about failed sources if there are packages meeting the version requirement.
.PP
\f[C]\-\-no\-cache\f[]
.PP
Specifies to not cache packages and HTTP requests.
.PP
\f[C]\-\-no\-dependencies\f[]
.PP
When restoring a project with project\-to\-project (P2P) references, restores the root project and not the references.
.PP
\f[C]\-\-packages\ <PACKAGES_DIRECTORY>\f[]
.PP
Specifies the directory for restored packages.
.PP
\f[C]\-r|\-\-runtime\ <RUNTIME_IDENTIFIER>\f[]
.PP
Specifies a runtime for the package restore.
This is used to restore packages for runtimes not explicitly listed in the \f[C]<RuntimeIdentifiers>\f[] tag in the \f[I].csproj\f[] file.
For a list of Runtime Identifiers (RIDs), see the RID catalog.
Provide multiple RIDs by specifying this option multiple times.
.PP
\f[C]\-s|\-\-source\ <SOURCE>\f[]
.PP
Specifies a NuGet package source to use during the restore operation.
This overrides all of the sources specified in the \f[I]NuGet.config\f[] files.
Multiple sources can be provided by specifying this option multiple times.
.PP
\f[C]\-\-verbosity\ <LEVEL>\f[]
.PP
Sets the verbosity level of the command.
Allowed values are \f[C]q[uiet]\f[], \f[C]m[inimal]\f[], \f[C]n[ormal]\f[], \f[C]d[etailed]\f[], and \f[C]diag[nostic]\f[].
.SH EXAMPLES
.PP
Restore dependencies and tools for the project in the current directory:
.PP
\f[C]dotnet\ restore\f[]
.PP
Restore dependencies and tools for the \f[C]app1\f[] project found in the given path:
.PP
\f[C]dotnet\ restore\ ~/projects/app1/app1.csproj\f[]
.PP
Restore the dependencies and tools for the project in the current directory using the file path provided as the source:
.PP
\f[C]dotnet\ restore\ \-s\ c:\\packages\\mypackages\f[]
.PP
Restore the dependencies and tools for the project in the current directory using the two file paths provided as sources:
.PP
\f[C]dotnet\ restore\ \-s\ c:\\packages\\mypackages\ \-s\ c:\\packages\\myotherpackages\f[]
.PP
Restore dependencies and tools for the project in the current directory and shows only minimal output:
.PP
\f[C]dotnet\ restore\ \-\-verbosity\ minimal\f[]
.SH AUTHORS
mairaw.