Skip to content

Commit 53478c2

Browse files
authored
Merge pull request #3317 from NuGet/main
Live drop for July 2024
2 parents 96ca7ca + 70547bf commit 53478c2

File tree

8 files changed

+82
-25
lines changed

8 files changed

+82
-25
lines changed

docs/concepts/Auditing-Packages.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,21 @@ We recommend that audit is configured at a repository level.
8787

8888
### Excluding advisories
8989

90-
There is no support for excluding individual advisories at this time.
90+
You can choose to exclude specific advisories from the audit report by adding a new `NuGetAuditSuppress` MSBuild item for each advisory.
91+
Define a `NuGetAuditSuppress` item with the `Include=` metadata set to the advisory URL you wish to suppress.
92+
93+
```xml
94+
<ItemGroup>
95+
<NuGetAuditSuppress Include="https://github.com/advisories/XXXX" />
96+
</ItemGroup>
97+
```
98+
99+
Similar to the other NuGet audit configuration properties, `NuGetAuditSuppress` items can be defined at the project or repository level.
100+
101+
`NuGetAuditSuppress` is available for PackageReference projects starting from NuGet 6.11, Visual Studio 17.11, and the .NET 8.0.400 SDK.
102+
It is not currently available for packages.config projects.
103+
104+
Additionally, you have the option to suppress warnings based on their severity.
91105
You can use `<NoWarn>` to suppress `NU1901`-`NU1904` warnings or use the `<NuGetAuditLevel>` functionality to ensure your audit reports are useful to your workflow.
92106

93107
### Warning codes

docs/consume-packages/configuring-nuget-behavior.md

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

1010
# Common NuGet configurations
1111

12-
NuGet's behavior is driven by the accumulated settings in one or more `NuGet.Config` (XML) files that can exist at solution- (project if no solution is used), user-, and computer-wide levels. A global `NuGetDefaults.Config` file also specifically configures package sources. Settings apply to all commands issued in the CLI, the Package Manager Console, and the Package Manager UI.
12+
NuGet's behavior is driven by the accumulated settings in one or more config (XML) files that can exist at solution- (project if no solution is used), user-, and computer-wide levels.
1313

1414
## Config file locations and uses
1515

@@ -58,29 +58,35 @@ Settings are managed using the NuGet CLI [config command](../reference/cli-refer
5858
Windows:
5959

6060
```cli
61-
# Set repositoryPath in the user-level config file
62-
nuget config -set repositoryPath=c:\packages
61+
# Set globalPackagesFolder in the user-level config file
62+
dotnet nuget config set globalPackagesFolder "C:\packages"
63+
64+
# Set repositoryPath (available for packages.config only) in the user-level config file
65+
dotnet nuget config set repositoryPath "C:\packages"
6366
6467
# Set repositoryPath in solution-level files
65-
nuget config -set repositoryPath=c:\packages -configfile c:\my.Config
66-
nuget config -set repositoryPath=c:\packages -configfile .\myApp\NuGet.Config
68+
dotnet nuget config set repositoryPath "C:\packages" --configfile "C:\my.config"
69+
dotnet nuget config set repositoryPath "c:\packages" --configfile "..\..\my.config"
6770
6871
# Set repositoryPath in the computer-level file (requires elevation)
69-
nuget config -set repositoryPath=c:\packages -configfile %ProgramFiles(x86)%\NuGet\Config\NuGet.Config
72+
dotnet nuget config set repositoryPath "c:\packages" --configfile "%appdata%\NuGet\NuGet.Config"
7073
```
7174

7275
Mac/Linux:
7376

7477
```cli
75-
# Set repositoryPath in the user-level config file
76-
nuget config -set repositoryPath=/home/packages
78+
# Set globalPackagesFolder in the user-level config file
79+
dotnet nuget config set globalPackagesFolder /home/packages
80+
81+
# Set repositoryPath (available for packages.config only) in the user-level config file
82+
dotnet nuget config set repositoryPath /home/packages
7783
7884
# Set repositoryPath in solution-level files
79-
nuget config -set repositoryPath=/home/projects/packages -configfile /home/my.Config
80-
nuget config -set repositoryPath=/home/packages -configfile home/myApp/NuGet.Config
85+
dotnet nuget config set repositoryPath /home/projects/packages --configfile /home/my.Config
86+
dotnet nuget config set repositoryPath /home/packages --configfile home/myApp/NuGet.Config
8187
8288
# Set repositoryPath in the computer-level file (requires elevation)
83-
nuget config -set repositoryPath=/home/packages -configfile $XDG_DATA_HOME/NuGet.Config
89+
dotnet nuget config set repositoryPath /home/packages --configfile $XDG_DATA_HOME/NuGet.Config
8490
```
8591

8692
> [!Note]
@@ -100,7 +106,10 @@ nuget config -set repositoryPath= -configfile /home/my.Config
100106

101107
### Creating a new config file
102108

103-
Copy the template below into the new file and then use `nuget config -configFile <filename>` to set values:
109+
Using the .NET CLI, create a default nuget.config by running `dotnet new nugetconfig`.
110+
For more information, see [dotnet CLI commands](../reference/dotnet-commands.md#package-consumption).
111+
112+
Alternatively, manually copy the template below into the new file and then use `nuget config -configFile <filename>` to set values:
104113

105114
```xml
106115
<?xml version="1.0" encoding="utf-8"?>
@@ -116,7 +125,7 @@ If a command line tool is used on a project file, rather than a solution file, t
116125

117126
Specifically, when a config file is not specified explicitly on the command line, NuGet loads settings from the different config files in the following order:
118127

119-
1. The [`NuGetDefaults.Config` file](#nuget-defaults-file), which contains settings related only to package sources.
128+
1. (*Uncommon*) The [`NuGetDefaults.Config` file](#nuget-defaults-file), which contains settings related only to package sources.
120129
1. The computer-level file.
121130
1. The user-level file.
122131
1. Files found in every folder in the path from the drive root to the current folder (where `nuget.exe` is invoked or the folder containing the Visual Studio solution). For example, if a command is invoked in `c:\A\B\C`, NuGet looks for and loads config files in `c:\`, then `c:\A`, then `c:\A\B`, and finally `c:\A\B\C`.
@@ -154,9 +163,9 @@ File A. User-level file, (`%appdata%\NuGet\NuGet.Config` on Windows, `~/.config/
154163
```xml
155164
<?xml version="1.0" encoding="utf-8"?>
156165
<configuration>
157-
<activePackageSource>
158-
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
159-
</activePackageSource>
166+
<packageSources>
167+
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
168+
</packageSources>
160169
</configuration>
161170
```
162171

@@ -226,7 +235,9 @@ These files cannot be edited by the standard tooling.
226235

227236
## NuGet defaults file
228237

229-
The `NuGetDefaults.Config` file exists to specify package sources from which packages are installed and updated, and to control the default target for publishing packages with `nuget push`. Because administrators can conveniently (using Group Policy, for example) deploy consistent `NuGetDefaults.Config` files to developer and build machines, they can ensure that everyone in the organization is using the correct package sources rather than nuget.org.
238+
The `NuGetDefaults.Config` is uncommon and can only specify package sources from which packages are installed and updated, or control the default target for publishing packages with `nuget push`.
239+
240+
Because administrators can conveniently (using Group Policy, for example) deploy consistent `NuGetDefaults.Config` files to developer and build machines, they can ensure that everyone in the organization is using consistent package sources, whether or not that includes nuget.org.
230241

231242
> [!Important]
232243
> The `NuGetDefaults.Config` file never causes a package source to be removed from a developer's NuGet configuration. That means if the developer has already used NuGet and therefore has the nuget.org package source registered, it won't be removed after the creation of a `NuGetDefaults.Config` file.

docs/consume-packages/install-use-packages-visual-studio.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,22 @@ To find and install a NuGet package with Visual Studio, follow these steps:
3838

3939
The **NuGet Package Manager** window opens.
4040

41-
1. Select the **Browse** tab to display packages by popularity from the currently selected source (see [Package sources](#package-sources)). To search for a specific package, use the search box on the upper left. Select a package from the list to display its information on the right pane, which enables you to select a version to install.
42-
43-
:::image type="content" source="media/package-manager-install-tab.png" alt-text="Screenshot showing the NuGet Package Manager window with the Browse tab selected.":::
41+
1. Select the **Browse** tab to display packages by popularity from the currently selected source (see [Package sources](#package-sources)).
42+
43+
- To search for a specific package, use the search box on the upper left.
44+
- Abbreviated information may be shown beside each package ID to help identify the correct package, and varies based on the selected package source(s).
45+
Examples include package download count, author, or owner profile hyperlinks.
46+
47+
> [!Note]
48+
> In Visual Studio 17.11 and higher, package owners are shown as profile hyperlinks when supported by the selected package source.
49+
> Package ownership is defined by the package source. For example, see [Manage package owners on nuget.org](../nuget-org/publish-a-package.md#manage-package-owners-on-nugetorg).
50+
>
51+
> In Visual Studio 17.10 and earlier, the package _author_ metadata is shown, which appears as plain-text.
52+
> For more information, see [Authors package metadata](../create-packages/package-authoring-best-practices.md#authors).
53+
54+
- Select a package to see detailed package information.
55+
The details pane on the right appears and enables you to select a version to install.
56+
![Screenshot showing the NuGet Package Manager window with the Browse tab selected.](media/package-manager-browse-tab.png)
4457

4558
1. In the right pane, select a **Version** from the dropdown list. If you want to include prerelease versions in the **Version** list, select **Include prerelease**.
4659

224 KB
Loading

docs/reference/errors-and-warnings/NU5104.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ The project or nuspec being packaged contains a dependency on a prerelease packa
2323
If you intend to create a prerelease package then please refer to SemVer2 guidelines and add a prerelease tag to the version property i.e. `<version>1.0.0-pre</version>`. If you intend to create a stable package then please update the specified dependency version to a stable version.
2424

2525
> [!NOTE]
26-
> Mixing stable and prerelease packages may lead to unexpected behaviors are resolution time. Learn more about how [PackageReference](../../concepts/Dependency-Resolution.md#version-ranges-and-prerelease-versions-with-packagereference) and [packages.config](../../concepts/Dependency-Resolution.md#version-ranges-and-prerelease-versions-with-packagesconfig) projects handle this resolution.
26+
> Mixing stable and prerelease packages may lead to unexpected behaviors at resolution time. Learn more about how [PackageReference](../../concepts/Dependency-Resolution.md#version-ranges-and-prerelease-versions-with-packagereference) and [packages.config](../../concepts/Dependency-Resolution.md#version-ranges-and-prerelease-versions-with-packagesconfig) projects handle this resolution.

docs/reference/nuget-config-file.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Contains miscellaneous configuration settings, which can be set using the [`nuge
3131
| Key | Value |
3232
| --- | --- |
3333
| dependencyVersion (`packages.config` only) | The default `DependencyVersion` value for package install, restore, and update, when the `-DependencyVersion` switch is not specified directly. This value is also used by the NuGet Package Manager UI. Values are `Lowest`, `HighestPatch`, `HighestMinor`, `Highest`. |
34-
| globalPackagesFolder (projects using PackageReference only) | The location of the default global packages folder. The default is `%userprofile%\.nuget\packages` (Windows) or `~/.nuget/packages` (Mac/Linux). A relative path can be used in project-specific `nuget.config` files. This setting is overridden by the `NUGET_PACKAGES` environment variable, which takes precedence. |
34+
| globalPackagesFolder | The location of the default global packages folder. The default is `%userprofile%\.nuget\packages` (Windows) or `~/.nuget/packages` (Mac/Linux). A relative path can be used in project-specific `nuget.config` files. This setting is overridden by the `NUGET_PACKAGES` environment variable, which takes precedence. |
3535
| repositoryPath (`packages.config` only) | The location in which to install NuGet packages instead of the default `$(Solutiondir)/packages` folder. A relative path can be used in project-specific `nuget.config` files. |
3636
| defaultPushSource | Identifies the URL or path of the package source that should be used as the default if no other package sources are found for an operation. |
3737
| http_proxy http_proxy.user http_proxy.password no_proxy | Proxy settings to use when connecting to package sources; `http_proxy` should be in the format `http://<username>:<password>@<domain>`. Passwords are encrypted and cannot be added manually. For `no_proxy`, the value is a comma-separated list of domains the bypass the proxy server. You can alternately use the http_proxy and no_proxy environment variables for those values. For additional details, see [NuGet proxy settings](http://skolima.blogspot.com/2012/07/nuget-proxy-settings.html) (skolima.blogspot.com). |

docs/reference/nuspec.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ In this topic:
3535

3636
## General form and schema
3737

38-
The current `nuspec.xsd` schema file can be found in the [NuGet GitHub repository](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Packaging/compiler/resources/nuspec.xsd).
38+
A `nuspec.xsd` schema file can be found in the [NuGet GitHub repository](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Packaging/compiler/resources/nuspec.xsd).
39+
Note, that this file only represents the most recent schema for a `.nuspec` file.
40+
No officially published versions exists and no version of that file corresponds to any specific NuGet version.
3941

4042
Within this schema, a `.nuspec` file has the following general form:
4143

@@ -64,6 +66,11 @@ All XML element names in the .nuspec file are case-sensitive, as is the case for
6466
metadata element `<description>` is correct and `<Description>` is not correct. The proper casing for each element name
6567
is documented below.
6668

69+
> [!Important]
70+
> While the `.nuspec` file contains a reference to a schema
71+
> (`xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"`),
72+
> The NuGet-Team has never published a schema file that could be used for automatic schema validation.
73+
6774
### Required metadata elements
6875

6976
Although the following elements are the minimum requirements for a package, you should consider adding the [optional metadata elements](#optional-metadata-elements) to improve the overall experience developers have with your package.

docs/release-notes/NuGet-6.10.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,20 @@ NuGet distribution vehicles:
1212

1313
| NuGet version | Available in Visual Studio version | Available in .NET SDK(s) |
1414
|:---|:---|:---|
15-
| [**6.10**](https://nuget.org/downloads) | [Visual Studio 2022 version 17.10](https://visualstudio.microsoft.com/downloads/) | [8.0.3xx](https://dotnet.microsoft.com/download/dotnet/8.0)<sup>1</sup> |
15+
| [**6.10.1**](https://nuget.org/downloads) | [Visual Studio 2022 version 17.10](https://visualstudio.microsoft.com/downloads/) | [8.0.3xx](https://dotnet.microsoft.com/download/dotnet/8.0)<sup>1</sup> |
1616

1717
<sup>1</sup> Installed with Visual Studio 2022 with any .NET workload
1818

19+
## Summary: What's New in 6.10.1
20+
21+
### Issues fixed in this release
22+
23+
* Visual Studio and PMC restore/update fails when multiple packages.config projects in the solution share the same name (An item with the same key has already been added) - [#13465](https://github.com/NuGet/Home/issues/13465)
24+
25+
* ##[error]The nuget command failed with exit code(1) and error(An item with the same key has already been added. - [#13456](https://github.com/NuGet/Home/issues/13456)
26+
27+
[List of commits in this release](https://github.com/NuGet/NuGet.Client/compare/6.10.0.97...6.10.1.5)
28+
1929
## Summary: What's New in 6.10
2030

2131
* [Feature]: add dotnet nuget config command - [#12469](https://github.com/NuGet/Home/issues/12469)
@@ -53,6 +63,8 @@ Public tracking issues and discussions can be found in the following locations:
5363

5464
* [DCR]: Central Package Management - Respect .props file as a way to opt-in to the feature. - [#11834](https://github.com/NuGet/Home/issues/11834)
5565

66+
* Remove NuGet.Packaging.Core - [#12495](https://github.com/NuGet/Home/issues/12495)
67+
5668
### Issues fixed in this release
5769

5870
* Warn when vulnerabilities are detected during packages.config restore in CLI scenarios. - [#13253](https://github.com/NuGet/Home/issues/13253)

0 commit comments

Comments
 (0)