Skip to content

Commit 3997b54

Browse files
authored
Merge pull request #3296 from NuGet/main
2 parents af2cd73 + e9fb125 commit 3997b54

21 files changed

+307
-53
lines changed

.github/workflows/stale-issues.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
close-issue-message: 'This issue is closed. If you feel this issue has been closed in error, please submit a new comment on the issue, and we will review it.'
2727
stale-issue-label: 'stale'
2828
close-issue-label: 'auto-close'
29-
exempt-issue-labels: 'exempt'
29+
exempt-issue-labels: 'exempt,P1'
3030
remove-stale-when-updated: true
3131
days-before-close: 14
32-
days-before-issue-stale: 180
32+
days-before-issue-stale: 90
3333
days-before-pr-stale: -1
34-
operations-per-run: 500
34+
operations-per-run: 500

.openpublishing.redirection.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,26 @@
364364
"source_path": "docs/tools/ps-ref-update-package.md",
365365
"redirect_url": "/nuget/reference/ps-reference/ps-ref-update-package",
366366
"redirect_document_id": false
367+
},
368+
{
369+
"source_path": "docs/reference/errors-and-warnings/NU1901.md",
370+
"redirect_url": "/nuget/reference/errors-and-warnings/NU1901-NU1904",
371+
"redirect_document_id": false
372+
},
373+
{
374+
"source_path": "docs/reference/errors-and-warnings/NU1902.md",
375+
"redirect_url": "/nuget/reference/errors-and-warnings/NU1901-NU1904",
376+
"redirect_document_id": false
377+
},
378+
{
379+
"source_path": "docs/reference/errors-and-warnings/NU1903.md",
380+
"redirect_url": "/nuget/reference/errors-and-warnings/NU1901-NU1904",
381+
"redirect_document_id": false
382+
},
383+
{
384+
"source_path": "docs/reference/errors-and-warnings/NU1904.md",
385+
"redirect_url": "/nuget/reference/errors-and-warnings/NU1901-NU1904",
386+
"redirect_document_id": false
367387
}
368388
]
369389
}

docs/TOC.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,8 @@
339339
### [Known Issues](release-notes/known-issues.md)
340340

341341
### NuGet 6.x
342+
#### [NuGet 6.10](release-notes/NuGet-6.10.md)
343+
#### [NuGet 6.9](release-notes/NuGet-6.9.md)
342344
#### [NuGet 6.8](release-notes/NuGet-6.8.md)
343345
#### [NuGet 6.7](release-notes/NuGet-6.7.md)
344346
#### [NuGet 6.6](release-notes/NuGet-6.6.md)

docs/api/_data/repository-signatures-index.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020
"notBefore": "2021-02-16T00:00:00.0000000Z",
2121
"notAfter": "2024-05-15T23:59:59.0000000Z",
2222
"contentUrl": "https://api.nuget.org/v3-index/repository-signatures/certificates/5a2901d6ada3d18260b9c6dfe2133c95d74b9eef6ae0e5dc334c8454d1477df4.crt"
23+
},
24+
{
25+
"fingerprints": {
26+
"2.16.840.1.101.3.4.2.1": "1f4b311d9acc115c8dc8018b5a49e00fce6da8e2855f9f014ca6f34570bc482d"
27+
},
28+
"subject": "CN=NuGet.org Repository by Microsoft, O=NuGet.org Repository by Microsoft, L=Redmond, S=Washington, C=US",
29+
"issuer": "CN=DigiCert Trusted G4 Code Signing RSA4096 SHA384 2021 CA1, O=\"DigiCert, Inc.\", C=US",
30+
"notBefore": "2024-02-23T00:00:00.0000000Z",
31+
"notAfter": "2027-05-18T23:59:59.0000000Z",
32+
"contentUrl": "https://api.nuget.org/v3-index/repository-signatures/certificates/1f4b311d9acc115c8dc8018b5a49e00fce6da8e2855f9f014ca6f34570bc482d.crt"
2333
}
2434
]
2535
}

docs/api/repository-signatures-resource.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ All hash values must be lowercase, hex-encoded string representations of the has
110110
### Sample request
111111

112112
```
113-
GET https://api.nuget.org/v3-index/repository-signatures/index.json
113+
GET https://api.nuget.org/v3-index/repository-signatures/5.0.0/index.json
114114
```
115115

116116
### Sample response

docs/api/search-query-service-resource.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ versions | array of objects | yes | All of the versions of
111111
authors | string or array of strings | no |
112112
iconUrl | string | no |
113113
licenseUrl | string | no |
114-
owners | string or array of strings | no |
114+
owners | string or array of strings | no | A string represents a single owner's username
115115
projectUrl | string | no |
116116
registration | string | no | The absolute URL to the associated [registration index](registration-base-url-resource.md#registration-index)
117117
summary | string | no |

docs/concepts/Auditing-Packages.md

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ This involves identifying vulnerabilities, evaluating risks, and making recommen
1616
The audit can include a review of the packages themselves, as well as any dependencies and their associated risks.
1717
The goal of the audit is to identify and mitigate any security vulnerabilities that could be exploited by attackers, such as code injection or cross-site scripting attacks.
1818

19-
NuGet Audit is available starting from NuGet 6.8, the .NET 8 SDK (8.0.100), and Visual Studio 2022 17.8.
19+
| Project Type | NuGet | .NET SDK | Visual Studio |
20+
|--------------|-------|----------|---------------|
21+
| PackageReference | 6.8 | .NET 8 SDK (8.0.100) | Visual Studio 2022 17.8 |
22+
| packages.config | 6.10 | N/A | Visual Studio 2022 17.10 |
2023

2124
## Running a security audit with `restore`
2225

@@ -28,16 +31,8 @@ A description of your dependencies is checked against a report of known vulnerab
2831
> NuGet.org's V3 URL is one such example (https://api.nuget.org/v3/index.json), but note that NuGet.org's V2 endpoint does not.
2932
3033
1. On the command line, navigate to your project or solution directory.
31-
1. Ensure your project or solution contains a `.csproj` file.
32-
1. Type `dotnet restore` or `restore` using your preferred tooling (i.e. MSBuild, NuGet.exe, etc).
33-
1. Review the audit report and address the known security vulnerabilities.
34-
35-
> [!NOTE]
36-
> At this time, NuGet does not audit `packages.config` projects.
37-
38-
## Reviewing and acting on the security audit report
39-
40-
Running `dotnet restore` will produce a report of security vulnerabilities with the affected package name, the severity of the vulnerability, and a link to the advisory for more details.
34+
1. Run `restore` using your preferred tooling (i.e. dotnet, MSBuild, NuGet.exe, VisualStudio etc).
35+
1. Review the warnings and address the known security vulnerabilities.
4136

4237
### Security vulnerabilities found with updates
4338

@@ -79,30 +74,16 @@ On NuGet.org, you can navigate to the package details page and click `Report pac
7974
If no security vulnerabilities are found, this means that packages with known vulnerabilities were not found in your package graph at the present moment of time you checked.
8075
Since the advisory database can be updated at any time, we recommend regularly checking your `dotnet restore` output and ensuring the same in your continuous integration process.
8176

82-
### Setting a security audit mode
83-
84-
By default, a security audit is done for top-level dependencies.
85-
In the case that you'd like to audit both top-level and transitive dependencies, you can set the `<NuGetAuditMode>` MSBuild property to the desired mode in which auditing will run.
86-
Possible values are `direct` and `all`.
87-
For example if you wanted to audit all dependencies for security advisories, you can set the following:
88-
89-
```xml
90-
<NuGetAuditMode>all</NuGetAuditMode>
91-
```
77+
### Configuring NuGet audit
9278

93-
> [!NOTE]
94-
> Visual Studio 2022 17.8 does not support changing audit mode for SDK style packages.
95-
> It works from 17.9 Preview 2.
96-
97-
### Setting a security audit level
98-
99-
In cases where you only care about a certain threshold of a security advisory severity, you can set the `<NuGetAuditLevel>` MSBuild property to the desired level in which auditing will fail.
100-
Possible values are `low`, `moderate`, `high`, and `critical`.
101-
For example if you only want to see `moderate`, `high`, and `critical` advisories, you can set the following:
79+
Audit can be configured via MSBuild properties in a `.csproj` or MSBuild file being evaluated as part of your project.
80+
We recommend that audit is configured at a repository level.
10281

103-
```xml
104-
<NuGetAuditLevel>moderate</NuGetAuditLevel>
105-
```
82+
| MSBuild Property | Default | Possible values | Notes |
83+
|------------------|---------|-----------------|-------|
84+
| NuGetAuditMode | direct | `direct` and `all` | If you'd like to audit both top-level and transitive dependencies, you can set the value to `all`. NuGetAuditMode is not applicable for packages.config projects |
85+
| NuGetAuditLevel | low | `low`, `moderate`, `high`, and `critical` | If you'd like to see `moderate`, `high`, and `critical` advisories, set the value to `moderate` |
86+
| NuGetAudit | true | `true` and `false` | If you wish to not receive security audit reports, you can opt-out of the experience entirely by setting the value to `false` |
10687

10788
### Excluding advisories
10889

@@ -123,13 +104,8 @@ You can customize your build to treat these warnings as errors to [treat warning
123104
For example, if you're already using `<TreatWarningsAsErrors>` to treat all (C#, NuGet, MSBuild, etc) warnings as errors, you can use `<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>` to prevent vulnerabilities discovered in the future from breaking your build.
124105
Alternatively, if you want to keep low and moderate vulnerabilities as warnings, but treat high and critical vulnerabilities as errors, and you're not using `TreatWarningsAsErrors`, you can use `<WarningsAsErrors>NU1903;NU1904</WarningsAsErrors>`.
125106

126-
### Disabling security auditing
127-
128-
At any time you wish to not receive security audit reports, you can opt-out of the experience entirely by setting the following MSBuild property in a `.csproj` or MSBuild file being evaluated as part of your project:
129-
130-
```xml
131-
<NuGetAudit>false</NuGetAudit>
132-
```
107+
> [!NOTE]
108+
> MSBuild properties for message severity such as `NoWarn` and `TreatWarningsAsErrors` are not supported for packages.config projects.
133109
134110
## Summary
135111

docs/concepts/Dependency-Resolution.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,21 @@ In some cases, it's not possible to meet all version requirements. As shown belo
112112

113113
In these situations, the top-level consumer (the application or package) should add its own direct dependency on Package B so that the [Direct dependency wins](#direct-dependency-wins) rule applies.
114114

115+
### Version ranges and prerelease versions with PackageReference
116+
117+
It is not unusual for a package to have both stable and prerelease versions available.
118+
When resolving a dependency graph, NuGet decides whether to consider prerelease versions for a package based on a single rule:
119+
`If the project or any packages within the graph request a prerelease version of a package, then include both prerelease or stable versions, otherwise consider stable versions only.`
120+
121+
In practice, under the lowest applicable rule, this means:
122+
123+
| Version Range | Available versions | Selected version |
124+
|---------------|--------------------|------------------|
125+
| [1.0.0, 2.0.0) | 1.2.0-beta.1, 1.2.0, | 1.2.0 |
126+
| [1.0.0, 2.0.0-0) | 1.2.0-beta.1, 1.2.0, | 1.2.0-beta.1 |
127+
| [1.0.0, 2.0.0) | 1.2.0-beta.1, 2.0.0-beta.3 | None, [NU1103](../reference/errors-and-warnings/NU1103.md) is raised. |
128+
| [1.0.0, 2.0.0-rc) | 1.2.0-beta.1, 2.0.0-beta.3 | 1.2.0-beta.1 |
129+
115130
## Dependency resolution with packages.config
116131

117132
With `packages.config`, a project's dependencies are written to `packages.config` as a flat list. Any dependencies of those packages are also written in the same list. When packages are installed, NuGet might also modify the `.csproj` file, `app.config`, `web.config`, and other individual files.
@@ -122,6 +137,11 @@ By default, NuGet 2.8 looks for the lowest patch version (see [NuGet 2.8 release
122137

123138
The `packages.config` process for resolving dependencies gets complicated for larger dependency graphs. Each new package installation requires a traversal of the whole graph and raises the chance for version conflicts. When a conflict occurs, installation is stopped, leaving the project in an indeterminate state, especially with potential modifications to the project file itself. This is not an issue when using other package management formats.
124139

140+
### Version ranges and prerelease versions with packages.config
141+
142+
packages.config resolution does not allow mixing of stable and pre-release dependency in a graph.
143+
If a dependency is expressed with a range like `[1.0.0, 2.0.0)`, pre-release packages are not allowed in the graph.
144+
125145
## Managing dependency assets
126146

127147
When using the PackageReference format, you can control which assets from dependencies flow into the top-level project. For details, see [PackageReference](../consume-packages/package-references-in-project-files.md#controlling-dependency-assets).

docs/concepts/Package-Versioning.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ Note that versions such as `1.0.1-rc.10` and `1.0.1-rc.2` are not parsable by ol
9595
If you use numerical suffixes with pre-release tags that might use double-digit numbers (or more), use leading zeroes as in beta01 and beta05 to ensure that they sort correctly when the numbers get larger.
9696
This recommendation only applies this schema.
9797

98+
Despite the ordering shown above, NuGet does not always consider both stable & prerelease packages during dependency resolution. Those rules are detailed in [Dependency Resolution](./Dependency-Resolution.md).
99+
98100
---
99101

100102
## Version ranges

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,15 @@ Multiple `NuGet.Config` files allow you to store settings in different locations
114114
These settings collectively apply to any NuGet operation invoked from the command line or from Visual Studio, with settings that exist "closest" to a solution or the current folder taking precedence.
115115
If a command line tool is used on a project file, rather than a solution file, then the project directory is used as the "solution directory", which can lead to inconsistent behaviour when there is a `NuGet.Config` file in a subdirectory of the solution file.
116116

117-
Specifically, NuGet loads settings from the different config files in the following order:
117+
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:
118118

119119
1. The [`NuGetDefaults.Config` file](#nuget-defaults-file), which contains settings related only to package sources.
120120
1. The computer-level file.
121121
1. The user-level file.
122-
1. The file specified with `-configFile`.
123122
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`.
124123

124+
When a config file is explicitly specified on the command line, for example `nuget -configFile my.config` or `dotnet restore --configfile my.config`, only the settings from the specified file will be used.
125+
125126
As NuGet finds settings in these files, they are applied as follows:
126127

127128
1. For single-item elements, NuGet replaced any previously-found value for the same key. This means that settings that are "closest" to the current folder or solution override any others found earlier. For example, the `defaultPushSource` setting in `NuGetDefaults.Config` is overridden if it exists in any other config file.

0 commit comments

Comments
 (0)