1dotnet restore command - .NET Core C.LNIEd(To1t)Cnoerterestore command - .NET Core CLI(1)
2
3
4

dotnet restore

NAME

7       dotnet restore - Restores the dependencies and tools of a project.
8

SYNOPSIS

10   .NET Core 2.x
11              dotnet restore [<ROOT>] [--configfile] [--disable-parallel] [--force] [--ignore-failed-sources] [--no-cache]
12                  [--no-dependencies] [--packages] [-r|--runtime] [-s|--source] [-v|--verbosity]
13              dotnet restore [-h|--help]
14
15   .NET Core 1.x
16              dotnet restore [<ROOT>] [--configfile] [--disable-parallel] [--ignore-failed-sources] [--no-cache]
17                  [--no-dependencies] [--packages] [-r|--runtime] [-s|--source] [-v|--verbosity]
18              dotnet restore [-h|--help]
19
20          *   *   *   *   *
21

DESCRIPTION

23       The  dotnet restore  command uses NuGet to restore dependencies as well
24       as project-specific tools that are specified in the project  file.   By
25       default, the restoration of dependencies and tools are executed in par‐
26       allel.
27
28       To restore the dependencies, NuGet needs the feeds where  the  packages
29       are  located.  Feeds are usually provided via the NuGet.config configu‐
30       ration file.  A default configuration file is  provided  when  the  CLI
31       tools are installed.  You specify additional feeds by creating your own
32       NuGet.config file in the project directory.  You also specify addition‐
33       al feeds per invocation at a command prompt.
34
35       For  dependencies,  you  specify where the restored packages are placed
36       during the restore operation using the  --packages  argument.   If  not
37       specified,  the  default NuGet package cache is used, which is found in
38       the .nuget/packages directory in the user's home directory on all oper‐
39       ating systems.  For example, /home/user1 on Linux or C:1 on Windows.
40
41       For project-specific tooling, dotnet restore first restores the package
42       in which the tool is packed, and then proceeds to  restore  the  tool's
43       dependencies as specified in its project file.
44
45       The  behavior  of the dotnet restore command is affected by some of the
46       settings in the Nuget.Config file, if present.   For  example,  setting
47       the  globalPackagesFolder  in  NuGet.Config  places  the restored NuGet
48       packages in the specified folder.  This is an alternative to specifying
49       the --packages option on the dotnet restore command.  For more informa‐
50       tion, see the NuGet.Config reference.
51
52   Implicit dotnet restore
53       Starting with .NET Core 2.0, dotnet restore is run implicitly if neces‐
54       sary when you issue the following commands:
55
56       · dotnet new
57
58       · dotnet build
59
60       · dotnet build server
61
62       · dotnet run
63
64       · dotnet test
65
66       · dotnet publish
67
68       · dotnet pack
69
70       In  most cases, you no longer need to explicitly use the dotnet restore
71       command.
72
73       Sometimes, it might be inconvenient to run  dotnet restore  implicitly.
74       For  example,  some  automated  systems, such as build systems, need to
75       call dotnet restore explicitly to control when the  restore  occurs  so
76       that  they  can  control network usage.  To prevent dotnet restore from
77       running implicitly, you can use the --no-restore flag with any of these
78       commands to disable implicit restore.
79
80   Arguments
81       ROOT
82
83       Optional path to the project file to restore.
84

OPTIONS

86   .NET Core 2.x
87       --configfile <FILE>
88
89       The  NuGet configuration file (NuGet.config) to use for the restore op‐
90       eration.
91
92       --disable-parallel
93
94       Disables restoring multiple projects in parallel.
95
96       --force
97
98       Forces all dependencies to be resolved even if  the  last  restore  was
99       successful.    Specifying  this  flag  is  the  same  as  deleting  the
100       project.assets.json file.
101
102       -h|--help
103
104       Prints out a short help for the command.
105
106       --ignore-failed-sources
107
108       Only warn about failed sources if there are packages meeting  the  ver‐
109       sion requirement.
110
111       --no-cache
112
113       Specifies to not cache packages and HTTP requests.
114
115       --no-dependencies
116
117       When  restoring a project with project-to-project (P2P) references, re‐
118       stores the root project and not the references.
119
120       --packages <PACKAGES_DIRECTORY>
121
122       Specifies the directory for restored packages.
123
124       -r|--runtime <RUNTIME_IDENTIFIER>
125
126       Specifies a runtime for the package restore.  This is used  to  restore
127       packages for runtimes not explicitly listed in the <RuntimeIdentifiers>
128       tag in the .csproj file.  For a list of Runtime Identifiers (RIDs), see
129       the  RID catalog.  Provide multiple RIDs by specifying this option mul‐
130       tiple times.
131
132       -s|--source <SOURCE>
133
134       Specifies a NuGet package source to use during the  restore  operation.
135       This setting overrides all of the sources specified in the NuGet.config
136       files.  Multiple sources can be provided by specifying this option mul‐
137       tiple times.
138
139       --verbosity <LEVEL>
140
141       Sets  the  verbosity level of the command.  Allowed values are q[uiet],
142       m[inimal], n[ormal], d[etailed], and diag[nostic].
143
144   .NET Core 1.x
145       --configfile <FILE>
146
147       The NuGet configuration file (NuGet.config) to use for the restore  op‐
148       eration.
149
150       --disable-parallel
151
152       Disables restoring multiple projects in parallel.
153
154       -h|--help
155
156       Prints out a short help for the command.
157
158       --ignore-failed-sources
159
160       Only  warn  about failed sources if there are packages meeting the ver‐
161       sion requirement.
162
163       --no-cache
164
165       Specifies to not cache packages and HTTP requests.
166
167       --no-dependencies
168
169       When restoring a project with project-to-project (P2P) references,  re‐
170       stores the root project and not the references.
171
172       --packages <PACKAGES_DIRECTORY>
173
174       Specifies the directory for restored packages.
175
176       -r|--runtime <RUNTIME_IDENTIFIER>
177
178       Specifies  a  runtime for the package restore.  This is used to restore
179       packages for runtimes not explicitly listed in the <RuntimeIdentifiers>
180       tag in the .csproj file.  For a list of Runtime Identifiers (RIDs), see
181       the RID catalog.  Provide multiple RIDs by specifying this option  mul‐
182       tiple times.
183
184       -s|--source <SOURCE>
185
186       Specifies  a  NuGet package source to use during the restore operation.
187       This overrides all of the sources specified in the NuGet.config  files.
188       Multiple  sources  can  be  provided by specifying this option multiple
189       times.
190
191       --verbosity <LEVEL>
192
193       Sets the verbosity level of the command.  Allowed values  are  q[uiet],
194       m[inimal], n[ormal], d[etailed], and diag[nostic].
195

EXAMPLES

197       Restore  dependencies and tools for the project in the current directo‐
198       ry:
199
200       dotnet restore
201
202       Restore dependencies and tools for the app1 project found in the  given
203       path:
204
205       dotnet restore ~/projects/app1/app1.csproj
206
207       Restore  the  dependencies and tools for the project in the current di‐
208       rectory using the file path provided as the source:
209
210       dotnet restore -s c:\packages\mypackages
211
212       Restore the dependencies and tools for the project in the  current  di‐
213       rectory using the two file paths provided as sources:
214
215       dotnet restore -s c:\packages\mypackages -s c:\packages\myotherpackages
216
217       Restore dependencies and tools for the project in the current directory
218       and shows only minimal output:
219
220       dotnet restore --verbosity minimal
221

AUTHORS

223       mairaw.
224
225
226
227                                     dotnet restore command - .NET Core CLI(1)
Impressum