dotnet-restore - Restores the dependencies and tools of a project.
dotnet restore [root] [--help] [--force-english-output] [--source]
[--packages] [--disable-parallel] [--fallbacksource] [--configfile]
[--no-cache] [--infer-runtimes] [--verbosity] [--ignore-failed-sources]
dotnet restore command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project.json file.
By default, the restoration of dependencies and tools are done in parallel.
In order to restore the dependencies, NuGet needs the feeds where the packages are located. Feeds are usually provided via the NuGet.config configuration file; a default one is present when the CLI tools are installed. You can specify more feeds by creating your own NuGet.config file in the project directory. Feeds can also be specified per invocation on the command prompt.
For dependencies, you can specify where the restored packages are placed during the restore operation using the
If not specified, the default NuGet package cache is used.
It is found in the
.nuget/packages directory in the user's home directory on all operating systems (for example, /home/user1 on Linux or C:\Users\user1 on Windows).
For project-specific tooling,
dotnet restore first restores the package in which the tool is packed, and then
proceeds to restore the tool's dependencies as specified in its project.json.
A list of projects or project folders to restore. Each value can be a path to a project.json or global.json file, or to a folder. If a folder is specified, the restore operation will recursively search for a project.json file in all subdirectories and restores for each project.json file found.
Prints out a short help for the command.
Forces the application to run using an invariant, English-based culture.
Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the NuGet.config file(s). Multiple sources can be provided by specifying this option multiple times.
Specifies the directory to place the restored packages in.
Disables restoring multiple projects in parallel.
Specifies a list of packages sources to use as a fallback in the restore operation if all other sources fail. All valid feed formats are allowed. Multiple fallback sources can be provided by specifying this option multiple times.
The NuGet configuration file (NuGet.config) to use for the restore operation.
Specifies to not cache packages and HTTP requests.
Temporary option to allow NuGet to infer Runtime Identifiers (RIDs) for legacy repositories.
The verbosity of logging to use. Allowed values:
Only warn about failed sources if there are packages meeting version requirement.
Restore dependencies and tools for the project in the current directory:
Restore dependencies and tools for the
app1 project found in the given path:
dotnet restore ~/projects/app1/project.json
Restore the dependencies and tools for the project in the current directory using the file path provided as the fallback source:
dotnet restore -f c:\packages\mypackages
Restore the dependencies and tools for the project in the current directory using the two file paths provided as the fallback sources:
dotnet restore -f c:\packages\mypackages -f c:\packages\myotherpackages
Restore dependencies and tools for the project in the current directory and shows only errors in the output:
dotnet restore --verbosity Error