Skip to content

Commit 23f32e8

Browse files
dsplaistedtdykstra
andauthored
Update dotnet restore documentation (#18074)
* Update dotnet restore documentation Fixes #15520. - Move information about implicit restore to the top of document (the first thing most people should know about this command is that you usually don't need to run it) - Fix terminology: Package cache -> Global packages folder * Update docs/core/tools/dotnet-restore.md Co-authored-by: Tom Dykstra <tdykstra@microsoft.com>
1 parent a40c7cd commit 23f32e8

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

docs/core/tools/dotnet-restore.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,17 @@ dotnet restore -h|--help
2626

2727
## Description
2828

29-
The `dotnet restore` 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 executed in parallel.
29+
The `dotnet restore` command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project file. In most cases, you don't need to explicitly use the `dotnet restore` command, since a NuGet restore is run implicitly if necessary when you run the following commands:
30+
31+
- [`dotnet new`](dotnet-new.md)
32+
- [`dotnet build`](dotnet-build.md)
33+
- [`dotnet build-server`](dotnet-build-server.md)
34+
- [`dotnet run`](dotnet-run.md)
35+
- [`dotnet test`](dotnet-test.md)
36+
- [`dotnet publish`](dotnet-publish.md)
37+
- [`dotnet pack`](dotnet-pack.md)
38+
39+
Sometimes, it might be inconvenient to run the implicit NuGet restore with these commands. For example, some automated systems, such as build systems, need to call `dotnet restore` explicitly to control when the restore occurs so that they can control network usage. To prevent the implicit NuGet restore, you can use the `--no-restore` flag with any of these commands to disable implicit restore.
3040

3141
### Specify feeds
3242

@@ -39,9 +49,9 @@ You can override the *nuget.config* feeds with the `-s` option.
3949

4050
For information about how to use authenticated feeds, see [Consuming packages from authenticated feeds](/nuget/consume-packages/consuming-packages-authenticated-feeds).
4151

42-
### Package cache
52+
### Global packages folder
4353

44-
For dependencies, you specify where the restored packages are placed during the restore operation using the `--packages` argument. If not specified, the default NuGet package cache is used, which 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.
54+
For dependencies, you can specify where the restored packages are placed during the restore operation using the `--packages` argument. If not specified, the default NuGet package cache is used, which 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.
4555

4656
### Project-specific tooling
4757

@@ -65,22 +75,6 @@ There are three specific settings that `dotnet restore` ignores:
6575

6676
This setting isn't applicable as [NuGet doesn't yet support cross-platform verification](https://github.com/NuGet/Home/issues/7939) of trusted packages.
6777

68-
## Implicit restore
69-
70-
The `dotnet restore` command is run implicitly if necessary when you run the following commands:
71-
72-
- [`dotnet new`](dotnet-new.md)
73-
- [`dotnet build`](dotnet-build.md)
74-
- [`dotnet build-server`](dotnet-build-server.md)
75-
- [`dotnet run`](dotnet-run.md)
76-
- [`dotnet test`](dotnet-test.md)
77-
- [`dotnet publish`](dotnet-publish.md)
78-
- [`dotnet pack`](dotnet-pack.md)
79-
80-
In most cases, you don't need to explicitly use the `dotnet restore` command.
81-
82-
Sometimes, it might be inconvenient to run `dotnet restore` implicitly. For example, some automated systems, such as build systems, need to call `dotnet restore` explicitly to control when the restore occurs so that they can control network usage. To prevent `dotnet restore` from running implicitly, you can use the `--no-restore` flag with any of these commands to disable implicit restore.
83-
8478
## Arguments
8579

8680
- **`ROOT`**

0 commit comments

Comments
 (0)