You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/consume-packages/Package-Source-Mapping.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ For detailed information on all Visual Studio NuGet options, see [NuGet Options
28
28
| 17.0 - 17.4 | ✅ Available | ❌ Not available | ❌ Not available |
29
29
| 17.5 | ✅ Available | ✅ Available | ❌ Not available |
30
30
| 17.7 Preview 3| ✅ Available | ✅ Available | ✅ Status displayed |
31
+
| 17.8 | ✅ Available | ✅ Available | ✅ [PackageReference automatically creates mappings](#installing-with-package-manager-ui)|
31
32
32
33
The feature is available across all NuGet integrated tooling.
33
34
@@ -106,6 +107,34 @@ The NuGet Package Manager window will refresh and reflect the new status of the
106
107
107
108
Package Source Mapping settings are applied following [nuget.config precedence rules](configuring-nuget-behavior.md#how-settings-are-applied) when multiple `nuget.config` files at various levels (machine-level, user-level, repo-level) are present.
108
109
110
+
## Installing with Package Manager UI
111
+
112
+
As of Visual Studio 17.8 or newer, when the criteria below is met, Package Manager UI will attempt to automatically create package source mappings for the package IDs being installed (the top-level and dependent packages), when using the package Install or Update features.
113
+
114
+
The following message will be shown when the criteria for this to happen automatically is met:
115
+
116
+
> A package source mapping will be created.
117
+
118
+
Currently, creating source mappings is automatic only when:
119
+
120
+
- The project is using PackageReference.
121
+
- Package source mapping is already enabled (you've added a mapping already, or created a section in your NuGet.Config).
122
+
- A single package source is selected in the dropdown (that is, selecting "All" for package sources is not supported as it is ambiguous which source should be mapped).
123
+
124
+

125
+
126
+
The operation may fail with [NU1110](../../docs/reference/errors-and-warnings/NU1110.md) if it's found that a dependency in your Global Packages Folder came from a package source that isn't enabled in your current solution.
127
+
See the error code documentation for ways to resolve this problem.
128
+
129
+
Selecting the "Show preview window" option will list the new package source mappings being created.
130
+
131
+
If the preview is not what you want for the source mappings, cancel the install and configure the relevant source mappings manually prior to performing the Install/Update.
132
+
133
+
For example, installing the package `Polly` results in both `Polly` and its dependency `Polly.Core` being automatically source mapped to the selected package source, nuget.org.
134
+
Microsoft dependent packages are being installed using existing package source mappings.
135
+
136
+

137
+
109
138
## Package Source Mapping rules
110
139
111
140
For maximum flexibility and control, NuGet requires that all packages match a package pattern through a well defined precedence.
0 commit comments