Skip to content

Commit e54b100

Browse files
authored
Update General Restore Options screenshots (#3486)
1 parent 521e509 commit e54b100

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

docs/consume-packages/Package-Restore.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ If the package references in your project file or your *packages.config* file ar
4444
If you have missing packages or package-related errors after you run Package Restore, such as error icons in Solution Explorer, follow the instructions in [Troubleshooting Package Restore errors](package-restore-troubleshooting.md), or [reinstall or update](../consume-packages/reinstalling-and-updating-packages.md) the packages. In Visual Studio, the Package Manager Console provides several options for reinstalling packages. For more information, see [Use Package-Update](reinstalling-and-updating-packages.md#update-package-command).
4545

4646
<a name="restore-using-visual-studio"></a>
47+
4748
## Restore packages in Visual Studio
4849

4950
In Visual Studio on Windows, you can restore packages automatically or manually. First, configure Package Restore through **Tools** > **Options** > **NuGet Package Manager**.
@@ -52,9 +53,10 @@ In Visual Studio on Windows, you can restore packages automatically or manually.
5253

5354
Configure the following Package Restore options at **Tools** > **Options** > **NuGet Package Manager** > **General**.
5455

55-
![Screenshot that shows the NuGet Package Manager options.](media/Restore-01-AutoRestoreOptions.png)
56+
![Screenshot that shows the NuGet Package Manager options.](media/vsoptions/general.png)
5657

5758
<a name="enable-and-disable-package-restore-in-visual-studio"></a>
59+
5860
#### Allow NuGet to download missing packages
5961

6062
Select **Allow NuGet to download missing packages** to enable package restore and the **Restore NuGet Packages** command. This selection sets the `packageRestore/enabled` setting to `True` in the [packageRestore section](../reference/nuget-config-file.md#packagerestore-section) of the global *NuGet.Config* file, at *%AppData%\\Roaming\\NuGet* on Windows or *~/.nuget/NuGet/* on Mac or Linux.
@@ -90,17 +92,20 @@ Select **Automatically check for missing packages during build in Visual Studio*
9092
You must select **Allow NuGet to download missing packages** as well as **Automatically check for missing packages during build in Visual Studio** in **Options** to enable package restore during build.
9193

9294
<a name="choose-default-package-management-format"></a>
95+
9396
#### Choose the default package management format
9497

9598
NuGet has two package management formats, [PackageReference](Package-References-in-Project-Files.md) and [packages.config](../reference/packages-config.md). Select the format you want to use from the dropdown list under **Package Management**. You can also select whether to allow format selection on first package install.
9699

97100
> [!Note]
101+
>
98102
> - If a project doesn't support both package management formats, NuGet uses the package management format that's compatible with the project, which might not be the default you set in the options. NuGet then won't prompt for selection on first install, even if you selected that option.
99103
>
100104
> - If you use Package Manager Console to install the first package in a project, NuGet doesn't prompt for format selection, even if that option is selected in **Options**.
101105
102106
<a name="restore-packages-automatically-using-visual-studio"></a>
103107
<a name="restore-packages-manually-using-visual-studio"></a>
108+
104109
### Restore packages manually or automatically
105110

106111
After you enable package restore in **Options**, you can right-click the solution in **Solution Explorer** and select **Restore NuGet Packages** to restore packages anytime.
@@ -112,6 +117,7 @@ For projects that use `<PackageReference>`, you can see the package references i
112117
If you see the error **This project references NuGet package(s) that are missing on this computer**, or **One or more NuGet packages need to be restored but couldn't be because consent has not been granted**, make sure you enabled automatic restore. For older projects, see [Migrate to automatic package restore](#migrate-to-automatic-package-restore-visual-studio). Also see [Troubleshooting package restore errors](Package-restore-troubleshooting.md).
113118

114119
<a name="restore-using-the-dotnet-cli"></a>
120+
115121
## Restore by using the dotnet CLI
116122

117123
[!INCLUDE [restore-dotnet-cli](includes/restore-dotnet-cli.md)]
@@ -120,11 +126,13 @@ If you see the error **This project references NuGet package(s) that are missing
120126
> To add a missing package reference to the project file, use [dotnet add package](/dotnet/core/tools/dotnet-add-package), which also runs `restore`.
121127
122128
<a name="restore-using-the-nugetexe-cli"></a>
129+
123130
## Restore by using the NuGet CLI
124131

125132
[!INCLUDE [restore-nuget-exe-cli](includes/restore-nuget-exe-cli.md)]
126133

127134
<a name="restore-using-msbuild"></a>
135+
128136
## Restore by using MSBuild
129137

130138
You can use [msbuild -t:restore](../reference/msbuild-targets.md#restore-target) to restore packages in NuGet 4.x+ and MSBuild 15.1+, which are included with Visual Studio 2017 and higher.
@@ -144,6 +152,7 @@ To use MSBuild restore:
144152
145153
<a name="restore-using-azure-pipelines"></a>
146154
<a name="restore-using-azure-devops-server"></a>
155+
147156
## Restore with Azure Pipelines or Azure DevOps Server
148157

149158
When you create a build definition in Azure Pipelines, you can include the [NuGet CLI restore](/azure/devops/pipelines/tasks/package/nuget#restore-nuget-packages) or [dotnet CLI restore](/azure/devops/pipelines/tasks/build/dotnet-core-cli) task in the definition before any build tasks. Some build templates include the restore task by default.
@@ -192,6 +201,7 @@ To avoid using packages in the HTTP cache:
192201
- For `nuget restore`, use the `-NoHttpCache` option, or for `dotnet restore`, use the `--no-http-cache` option. These options don't affect restore operations through the Visual Studio Package Manager or Console.
193202

194203
<a name="migrate-to-automatic-package-restore-visual-studio"></a>
204+
195205
## Migrate to automatic package restore
196206

197207
Earlier versions of NuGet supported an MSBuild-integrated package restore. Projects that use the deprecated MSBuild-integrated package restore should migrate to automatic package restore.

docs/consume-packages/Package-restore-troubleshooting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.topic: conceptual
99

1010
# Troubleshooting package restore errors
1111

12-
This article focuses on common errors when restoring packages and steps to resolve them.
12+
This article focuses on common errors when restoring packages and steps to resolve them.
1313

1414
Package Restore tries to install all package dependencies to the correct state matching the package references in your project file (*.csproj*) or your *packages.config* file. (In Visual Studio, the references appear in Solution Explorer under the **Dependencies \ NuGet** or the **References** node.) To follow the required steps to restore packages, see [Restore packages](../consume-packages/package-restore.md#restore-packages). If the package references in your project file (*.csproj*) or your *packages.config* file are incorrect (they do not match your desired state following Package Restore), then you need to either install or update packages instead of using Package Restore.
1515

@@ -24,7 +24,7 @@ If you're using Visual Studio, first enable package restore as follows. Otherwis
2424
1. Select **OK**.
2525
1. Build your project again.
2626

27-
![Enable NuGet package restore in Tool/Options](../consume-packages/media/restore-01-autorestoreoptions.png)
27+
![Enable NuGet package restore in Tool/Options](../consume-packages/media/vsoptions/general.png)
2828

2929
These settings can also be changed in your `NuGet.Config` file; see the [consent](#consent) section. If your project is an older project that uses the MSBuild-integrated package restore, you may need to [migrate](package-restore.md#migrate-to-automatic-package-restore-visual-studio) to automatic package restore.
3030

-22.2 KB
Binary file not shown.
-20.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)