Skip to content

Commit 8e1612e

Browse files
authored
What's new for .NET 9 Preview 6 (dotnet#41745)
1 parent 9cfd224 commit 8e1612e

File tree

24 files changed

+945
-129
lines changed

24 files changed

+945
-129
lines changed

docs/core/compatibility/sdk/8.0/dotnet-restore-audit.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Previously, `dotnet restore` did not emit any security vulnerability warnings by
1313

1414
## New behavior
1515

16-
If you're developing with the .NET 8 SDK or a later version, `dotnet restore` produces security vulnerability warnings by default for *all* restored projects. When you load a solution or project, or run a CI/CD script, this change may break your workflow if you have `<TreatWarningsAsErrors>` enabled.
16+
If you're developing with the .NET 8 SDK or a later version, `dotnet restore` produces security vulnerability warnings by default for *all* restored projects. When you load a solution or project, or run a CI/CD script, this change might break your workflow if you have `<TreatWarningsAsErrors>` enabled.
1717

1818
## Version introduced
1919

@@ -25,7 +25,7 @@ This change is a [behavioral change](../../categories.md#behavioral-change).
2525

2626
## Reason for change
2727

28-
In most cases when you restore a package, you want to know whether the restored package version contains any known security vulnerabilities. This functionality was added as it is a highly requested feature and security concerns continue to increase each year where known security issues can not be visible enough to taking immediate action.
28+
Many users want to know whether the packages they restore contain any known security vulnerabilities. This functionality was a highly requested feature. Security concerns continue to increase each year and some known security issues aren't visible enough to take immediate action.
2929

3030
## Recommended action
3131

@@ -39,4 +39,5 @@ In most cases when you restore a package, you want to know whether the restored
3939

4040
## See also
4141

42+
- [Audit for security vulnerabilities (`dotnet restore`)](../../../tools/dotnet-restore.md#audit-for-security-vulnerabilities)
4243
- [Auditing package dependencies for security vulnerabilities](/nuget/concepts/auditing-packages)

docs/core/diagnostics/metrics-instrumentation.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ summarize the distribution differently or offer more configuration options.
327327
```csharp
328328
using System;
329329
using System.Diagnostics.Metrics;
330-
330+
331331
class Program
332332
{
333333
// BEWARE! Static initializers only run when code in a running method refers to a static variable.
@@ -336,7 +336,7 @@ summarize the distribution differently or offer more configuration options.
336336
static Meter s_meter = new Meter("HatCo.Store");
337337
static ObservableCounter<int> s_coatsSold = s_meter.CreateObservableCounter<int>("hatco.store.coats_sold", () => s_rand.Next(1,10));
338338
static Random s_rand = new Random();
339-
339+
340340
static void Main(string[] args)
341341
{
342342
Console.ReadLine();
@@ -502,8 +502,7 @@ Press p to pause, r to resume, q to quit.
502502

503503
### Best practices
504504

505-
- Although the API allows any object to be used as the tag value, numeric types and strings are anticipated by collection tools. Other types may or may not be
506-
supported by a given collection tool.
505+
- Although the API allows any object to be used as the tag value, numeric types and strings are anticipated by collection tools. Other types may or may not be supported by a given collection tool.
507506

508507
- We recommend tag names follow the [OpenTelemetry naming guidelines](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/metrics.md#general-guidelines),
509508
which use lowercase dotted hierarchal names with '_' characters to separate multiple words in the same element. If tag names are reused in different metrics or other telemetry
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: "BC0101: Shared output path"
3+
description: Learn about .NET SDK error BC0101, which occurs when an output path or intermediate outpath is shared between multiple projects.
4+
ms.topic: error-reference
5+
ms.date: 07/10/2024
6+
f1_keywords:
7+
- BC0101
8+
---
9+
# BC0101
10+
11+
**This article applies to:** ✔️ .NET 9 SDK and later versions
12+
13+
It's not recommended to share an output path or intermediate output path between multiple projects. Such practice can lead to silent overwrites of the outputs. Order of write depends on the order of the build, which isn't guaranteed unless explicitly configured. Sharing an output path can cause nondeterministic behavior of the build.
14+
15+
If you want to produce outputs in a consolidated output folder, consider using the [Artifacts output layout](../../sdk/artifacts-output.md) or [Microsoft.Build.Artifacts SDK](https://github.com/microsoft/MSBuildSdks/tree/main/src/Artifacts).
16+
17+
The full error message is similar to the following example:
18+
19+
> **BC0101: Two projects should not share their OutputPath or IntermediateOutputPath locations.**
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: "BC0102: Double writes"
3+
description: Learn about .NET SDK error BC0102, which occurs when multiple tasks attempt to write to a single file.
4+
ms.topic: error-reference
5+
ms.date: 07/10/2024
6+
f1_keywords:
7+
- BC0102
8+
---
9+
# BC0102
10+
11+
**This article applies to:** ✔️ .NET 9 SDK and later versions
12+
13+
Multiple tasks attempt to write to a single file. Such behavior can lead to nondeterminism of a build (results can be dependent on the order of task execution if they belong to independent projects) or to lost updates.
14+
15+
If multiple tasks need to produce or update a single file in a one-by-one pipeline fashion, each intermediate output should be given a distinct name. Distinct files prevent silent mixups if any of the tasks in the chain are skipped or removed.
16+
17+
The full error message is similar to the following example:
18+
19+
> **BC0102: Two tasks should not write the same file.**
20+
21+
This rule flags a similar problem as [BC0101 - Shared output path](bc0101.md), but applies more generally to *any* tasks that write to a file.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: BuildCheck rule list
3+
description: A complete list of BCxxxx build check errors.
4+
ms.topic: error-reference
5+
ms.date: 07/10/2024
6+
ms.custom: updateeachrelease
7+
f1_keywords:
8+
- BC0101
9+
- BC0102
10+
---
11+
# BuildCheck rule list
12+
13+
**This article applies to:** ✔️ .NET 9 SDK and later versions
14+
15+
The following list includes all build-check warnings that you might get from the .NET SDK.
16+
17+
| Rule | Message |
18+
|---------------------|-------------------------------------------------------------------------------------|
19+
| [BC0101](bc0101.md) | Two projects should not share their OutputPath or IntermediateOutputPath locations. |
20+
| [BC0102](bc0102.md) | Two tasks should not write the same file. |

docs/core/tools/dotnet-restore.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,11 @@ There are three specific settings that `dotnet restore` ignores:
192192

193193
## Audit for security vulnerabilities
194194

195-
Starting in .NET 8, you can opt into NuGet security auditing for `dotnet restore`. This auditing produces a report of security vulnerabilities with the affected package name, the severity of the vulnerability, and a link to the advisory for more details.
195+
Starting in .NET 8, `dotnet restore` includes NuGet security auditing. This auditing produces a report of security vulnerabilities with the affected package name, the severity of the vulnerability, and a link to the advisory for more details.
196196

197-
To opt into security auditing, set the `<NuGetAudit>` MSBuild property to `true` in your project file. Additionally, to retrieve the known vulnerability dataset, ensure that you have the NuGet.org central registry defined as one of your package sources:
197+
To opt out of the security auditing, set the `<NuGetAudit>` MSBuild property to `false` in your project file.
198+
199+
To retrieve the known vulnerability dataset, ensure that you have the NuGet.org central registry defined as one of your package sources:
198200

199201
```xml
200202
<packageSources>
@@ -203,3 +205,7 @@ To opt into security auditing, set the `<NuGetAudit>` MSBuild property to `true`
203205
```
204206

205207
You can configure the level at which auditing will fail by setting the `<NuGetAuditLevel>` MSBuild property. Possible values are `low`, `moderate`, `high`, and `critical`. For example if you only want to see moderate, high, and critical advisories, you can set the property to `moderate`.
208+
209+
Starting in .NET 9, NuGet audits both *direct* and *transitive* package references, by default. In .NET 8, only *direct* package references are audited. You can change the mode by setting the `<NuGetAuditMode>` MSBuild property to `direct` or `all`.
210+
211+
For more information, see [Auditing package dependencies for security vulnerabilities](/nuget/concepts/auditing-packages).

docs/core/whats-new/dotnet-8/sdk.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This section contains the following subtopics:
1919
- [Simplified output paths](#simplified-output-paths)
2020
- ['dotnet workload clean' command](#dotnet-workload-clean-command)
2121
- ['dotnet publish' and 'dotnet pack' assets](#dotnet-publish-and-dotnet-pack-assets)
22+
- [`dotnet restore` security auditing](#dotnet-restore-security-auditing)
2223
- [Template engine](#template-engine)
2324
- [Source Link](#source-link)
2425
- [Source-build SDK](#source-build-sdk)

0 commit comments

Comments
 (0)