Skip to content

Commit 3c67341

Browse files
gewarrenCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent e1e10d1 commit 3c67341

4 files changed

Lines changed: 24 additions & 24 deletions

File tree

docs/core/whats-new/dotnet-11/libraries.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This article describes new features in the .NET libraries for .NET 11. It was la
1313

1414
## Process API expansion
1515

16-
<xref:System.Diagnostics.Process> gains a substantial set of new APIs in Preview 4, covering common scenarios where you previously had to wire up `OutputDataReceived`/`ErrorDataReceived` events manually or use P/Invoke.
16+
<xref:System.Diagnostics.Process> has a substantial set of new APIs that cover common scenarios where you previously had to wire up `OutputDataReceived`/`ErrorDataReceived` events manually or use P/Invoke.
1717

1818
### Run-and-capture helpers
1919

@@ -133,7 +133,7 @@ BFloat16 (Brain Floating Point) is a 16-bit floating-point format that's commonl
133133

134134
## UTF validation and invalid-subsequence search
135135

136-
Preview 4 adds two complementary features to <xref:System.Text.Unicode?displayProperty=fullName>. `Utf16.IsValid` answers whether a sequence is well-formed UTF-16 without scanning twice, and `Utf8.IndexOfInvalidSubsequence` / `Utf16.IndexOfInvalidSubsequence` return the position of the first ill-formed code-unit sequence (or `-1` for valid input). Together these let parsers, validators, and serializers report precise errors instead of generic encoding-error messages.
136+
<xref:System.Text.Unicode?displayProperty=fullName> has two new complementary features. `Utf16.IsValid` answers whether a sequence is well-formed UTF-16 without scanning twice, and `Utf8.IndexOfInvalidSubsequence` / `Utf16.IndexOfInvalidSubsequence` return the position of the first ill-formed code-unit sequence (or `-1` for valid input). Together, these methods let parsers, validators, and serializers report precise errors instead of generic encoding-error messages.
137137

138138
:::code language="csharp" source="./snippets/csharp/Libraries.cs" id="UtfValidation":::
139139

@@ -198,7 +198,7 @@ let json = System.Text.Json.JsonSerializer.Serialize(Circle 1.5)
198198

199199
### Utf8JsonWriter.Reset with options
200200

201-
<xref:System.Text.Json.Utf8JsonWriter.Reset*> now accepts a <xref:System.Text.Json.JsonWriterOptions> parameter, so writer instances can be re-pooled with different options without allocating a new writer:
201+
<xref:System.Text.Json.Utf8JsonWriter.Reset*> now accepts a <xref:System.Text.Json.JsonWriterOptions> parameter, so writer instances can be repooled with different options without allocating a new writer:
202202

203203
:::code language="csharp" source="./snippets/csharp/Libraries.cs" id="Utf8JsonWriterReset":::
204204

@@ -253,15 +253,15 @@ A new <xref:System.Text.RegularExpressions.RegexOptions> flag, `AnyNewLine`, mak
253253

254254
### Regex engine and source generator fixes
255255

256-
Preview 4 also includes several regex correctness and code-quality fixes:
256+
.NET 11 includes several regex correctness and code-quality fixes:
257257

258258
- The non-backtracking engine no longer takes super-linear time on certain nested-loop patterns and produces correct results for cases that previously diverged.
259259
- The regex compiler and source generator handle `resumeAt` correctly when a conditional appears inside a loop body.
260-
- The SYSLIB1045 code fixer no longer creates duplicate class names when applied across multiple partial declarations of the same class.
260+
- The [SYSLIB1045](../../../fundamentals/syslib-diagnostics/syslib1040-1049.md) code fixer no longer creates duplicate class names when applied across multiple partial declarations of the same class.
261261

262262
## Rate-limiting improvements
263263

264-
A cluster of <xref:System.Threading.RateLimiting?displayProperty=fullName> fixes lands in Preview 4:
264+
The <xref:System.Threading.RateLimiting?displayProperty=fullName> class has a handful of fixes in .NET 11:
265265

266266
- <xref:System.Threading.RateLimiting.FixedWindowRateLimiter> now reports a `RetryAfter` metadata value that points to the next window boundary, so callers and middleware can honor it without guessing.
267267
- `TokenBucketRateLimiter.AttemptAcquire(0)` no longer mishandles partial token refills.
@@ -312,7 +312,7 @@ Pass an `IMeterFactory` to the new `MemoryCache(options, loggerFactory, meterFac
312312
> [!NOTE]
313313
> This is a preview feature in .NET 11.
314314
315-
Preview 4 introduces `UnionAttribute` and `IUnion` in `System.Runtime.CompilerServices`. These types are the runtime side of the C# discriminated-union design. They aren't directly user-facing yet—the C# compiler and source generators are the expected producers—but they ship in the framework so libraries can author against the surface now.
315+
.NET 11 introduces `UnionAttribute` and `IUnion` in `System.Runtime.CompilerServices`. These types are the runtime side of the C# discriminated-union design. They aren't directly user-facing yet—the C# compiler and source generators are the expected producers—but they ship in the framework so libraries can author against the surface now.
316316

317317
For the language-side design, see the [C# unions proposal](https://github.com/dotnet/csharplang/blob/main/proposals/unions.md).
318318

docs/core/whats-new/dotnet-11/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Your feedback is important and appreciated. If you have questions or comments, u
2020
The .NET 11 runtime includes:
2121

2222
- Updated minimum hardware requirements for x86/x64 and Arm64 architectures, requiring more modern instruction sets to improve performance and reduce maintenance complexity.
23-
- Runtime-native async (Runtime Async), which produces cleaner stack traces and lower overhead. Starting with Preview 3, Runtime Async no longer requires `<EnablePreviewFeatures>true</EnablePreviewFeatures>` for projects that target `net11.0`. Starting with Preview 4, the runtime libraries themselves are compiled with runtime-async.
24-
- JIT improvements for bounds check elimination, redundant checked context removal, switch expression folding, constant-folding `SequenceEqual`, and redundant branch elimination. Preview 4 also adds new Arm SVE2 intrinsics and improved hardware-intrinsic cost modeling.
23+
- Runtime-native async (Runtime Async), which produces cleaner stack traces and lower overhead. Runtime Async no longer requires `<EnablePreviewFeatures>true</EnablePreviewFeatures>` for projects that target `net11.0`. The runtime libraries themselves are compiled with `runtime-async=on`.
24+
- JIT improvements for bounds check elimination, redundant checked context removal, switch expression folding, constant-folding `SequenceEqual`, and redundant branch elimination. There are also new Arm SVE2 intrinsics and improved hardware-intrinsic cost modeling.
2525
- `Comparer<T>.Default` and `EqualityComparer<T>.Default` specialized in ReadyToRun images, delivering up to 20× faster collection operations.
2626
- WebAssembly improvements, including WebCIL V1 as the default for CoreCLR WASM builds, native re-link support, and better debugging symbols.
2727
- Support for more than 1024 CPUs on Linux.
@@ -53,7 +53,7 @@ For more information, see [What's new in the .NET 11 libraries](libraries.md).
5353

5454
The .NET 11 SDK includes:
5555

56-
- Smaller SDK installers on Linux and macOS through assembly deduplication, with additional savings in Preview 4 by skipping crossgen for `DotnetTools`-only assemblies.
56+
- Smaller SDK installers on Linux and macOS through assembly deduplication, with additional savings by skipping crossgen for `DotnetTools`-only assemblies.
5757
- Improved [CA1873](../../../fundamentals/code-analysis/quality-rules/ca1873.md) code analyzer with reduced noise and clearer diagnostic messages.
5858
- Analyzer bug fixes for [CA1515](../../../fundamentals/code-analysis/quality-rules/ca1515.md), [CA1034](../../../fundamentals/code-analysis/quality-rules/ca1034.md), and [CA1859](../../../fundamentals/code-analysis/quality-rules/ca1859.md).
5959
- A new NETSDK1235 warning for custom `.nuspec` files used with PackAsTool.

docs/core/whats-new/dotnet-11/runtime.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ Runtime Async is a preview feature. To opt in, add the following property to you
6969
</PropertyGroup>
7070
```
7171

72-
Starting with Preview 3, a `net11.0` project no longer requires `<EnablePreviewFeatures>true</EnablePreviewFeatures>` to use Runtime Async.
72+
A `net11.0` project no longer requires `<EnablePreviewFeatures>true</EnablePreviewFeatures>` to use Runtime Async.
7373

74-
Starting with Preview 4, the .NET runtime libraries themselves are compiled with `runtime-async=on`. The runtime libraries no longer contain compiler-generated state machines and rely entirely on runtime-provided async. This makes it possible to migrate an entire app (with only library dependencies) to the new model, and it provides broad functional and performance validation of the feature. The product team welcomes any reports—positive or negative—about throughput and library size changes you observe.
74+
The .NET runtime libraries themselves are compiled with `runtime-async=on`. The runtime libraries no longer contain compiler-generated state machines and rely entirely on runtime-provided async. This makes it possible to migrate an entire app (with only library dependencies) to the new model, and it provides broad functional and performance validation of the feature. The product team welcomes any reports—positive or negative—about throughput and library size changes you observe.
7575

76-
Preview 4 also includes two additional improvements:
76+
.NET 11 also includes two additional improvements:
7777

7878
- **Covariant `Task``Task<T>` overrides:** When a derived class returns `Task<T>` for a base method that returns `Task`, the runtime now generates a void-returning thunk that bridges the calling convention difference, so virtual dispatch works for both flavors. The same fix applies to NativeAOT.
7979
- **Inlining in crossgen2:** Restrictions that prevented runtime-async methods from being inlined during ReadyToRun (R2R) compilation have been removed. All async tests pass with both crossgen2 and composite R2R, and inlining of await-less async calls (the synchronous fast path) is confirmed end-to-end.
@@ -137,7 +137,7 @@ Breakpoints now bind correctly inside runtime-async methods, and the debugger ca
137137
- **Devirtualization in ReadyToRun images:** ReadyToRun (R2R) images can now devirtualize non-shared generic virtual method calls, improving performance of ahead-of-time compiled code for generic scenarios.
138138
- **SVE2 intrinsics:** New Arm SVE2 (Scalable Vector Extension 2) intrinsics are available: `ShiftRightLogicalNarrowingSaturate(Even|Odd)`. These expand the set of vectorized operations available on Arm hardware that supports SVE2.
139139

140-
For better performance and code quality, Preview 4 adds several more JIT optimizations:
140+
For better performance and code quality, .NET 11 adds several more JIT optimizations:
141141

142142
### Constant-folding SequenceEqual
143143

@@ -179,7 +179,7 @@ These optimizations are most visible after inlining, where guards from different
179179

180180
## Hardware intrinsics and code generation
181181

182-
Preview 4 includes several new hardware intrinsics and code generation improvements:
182+
.NET 11 includes several new hardware intrinsics and code generation improvements:
183183

184184
- **F16C acceleration for `Half``float` conversions on x64:** When the CPU supports F16C (most AVX2-capable hardware), conversions between <xref:System.Half> and `float`/`double` now use the dedicated `vcvtph2ps`/`vcvtps2ph` instructions instead of helper calls.
185185
- **Better cost modeling for x86/x64 SIMD:** The JIT's floating-point execution and size costs previously reflected x87-era assumptions. Updated costs that reflect modern SSE/AVX hardware let the JIT make better decisions about hoisting and common subexpression elimination (CSE) around SIMD code.
@@ -207,7 +207,7 @@ Preview 3 expands browser and WebAssembly support with several improvements:
207207
- **Better debugging symbols:** Symbol and stack trace quality for WebAssembly debugging has improved, making it easier to diagnose issues in browser-hosted .NET apps.
208208
- **`float[]`, `Span<float>`, and `ArraySegment<float>` marshaling:** `float[]`, `Span<float>`, and `ArraySegment<float>` are now marshaled more directly across JavaScript boundaries, reducing overhead for interop-heavy code.
209209

210-
Preview 4 adds significant CoreCLR-on-WebAssembly progress:
210+
.NET includes improvements to CoreCLR-on-WebAssembly:
211211

212212
- **WebCIL V1 is the default for CoreCLR WASM builds:** The shared WebCIL header gains a `TableBase` field (28 → 32 bytes). Both Mono and CoreCLR readers accept V0 and V1. Crossgen2's `WasmObjectWriter` produces V1 directly, and CoreCLR-flavored WASM SDK builds default `WasmWebcilVersion` to `V1`.
213213
- **Native re-link works for CoreCLR WASM apps:** A full Emscripten-based pipeline replaces the previous stub targets. Re-linking `dotnet.native.wasm` from the runtime pack and including custom native code via `NativeFileReference` now works.

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Analysis found that 35% of the SDK directory consists of duplicate files. On Lin
2424
| linux-x64 | rpm | 165 | 122 | 26.0% |
2525
| linux-x64 | containers | Varies | Varies | 8–17% |
2626

27-
Preview 4 trims the SDK further by skipping crossgen for assemblies that only exist under `DotnetTools/`. Assemblies that also exist outside `DotnetTools/` are still crossgen'd—they get the startup benefit and the duplicate is then removed—but assemblies unique to `DotnetTools/` are left as IL-only. On a `linux-x64` build, this reduces the SDK tarball by an additional 23.6 MB.
27+
The SDK is further trimmed because crossgen is skipped for assemblies that only exist under `DotnetTools/`. Assemblies that also exist outside `DotnetTools/` are still crossgen'd—they get the startup benefit and the duplicate is then removed—but assemblies unique to `DotnetTools/` are left as IL-only. On a `linux-x64` build, this reduces the SDK tarball by an additional 23.6 MB.
2828

2929
Windows deduplication is planned for a future preview.
3030

@@ -116,24 +116,24 @@ Environment variables passed this way are available to MSBuild logic as `Runtime
116116

117117
## dotnet watch improvements
118118

119-
Preview 3 adds several `dotnet watch` improvements for long-running local development loops:
119+
.NET 11 adds several `dotnet watch` improvements for long-running local development loops:
120120

121121
- **Aspire integration:** `dotnet watch` can now integrate with Aspire app hosts, enabling hot-reload workflows across the full Aspire application model.
122122
- **Crash recovery:** When the app crashes, `dotnet watch` automatically relaunches it on the next relevant file change.
123123
- **Windows desktop support:** Ctrl+C handling is improved for Windows desktop apps such as Windows Forms and WPF.
124124

125-
Preview 4 adds device selection for MAUI and mobile projects. After picking a target framework, `dotnet watch` calls the `ComputeAvailableDevices` MSBuild target, auto-selects when there's a single device, and shows an interactive picker with search when there are several. The chosen device flows through to `dotnet build` and the launched `dotnet run` subprocess, including a re-restore when the device requires a `RuntimeIdentifier` not present in the original restore.
125+
.NET 11 also adds device selection for MAUI and mobile projects. After picking a target framework, `dotnet watch` calls the `ComputeAvailableDevices` MSBuild target, auto-selects when there's a single device, and shows an interactive picker with search when there are several. The chosen device flows through to `dotnet build` and the launched `dotnet run` subprocess, including a re-restore when the device requires a `RuntimeIdentifier` not present in the original restore.
126126

127127
To pre-select a device from the command line, use:
128128

129129
```bash
130130
dotnet watch --device <device-id>
131131
```
132132

133-
Preview 4 also fixes several long-standing `dotnet watch` issues:
133+
The following long-standing `dotnet watch` issues are fixed:
134134

135135
- The framework selection prompt no longer appears stuck due to two readers both calling `Console.ReadKey()`.
136-
- Ctrl+C and Ctrl+R no longer surface a spurious `WebSocketException` or `ObjectDisposedException` when the WebSocket transport tears down.
136+
- <kbd>Ctrl+C</kbd> and <kbd>Ctrl+R</kbd> no longer surface a spurious `WebSocketException` or `ObjectDisposedException` when the WebSocket transport tears down.
137137
- Hot Reload no longer deadlocks on iOS when `UIKitSynchronizationContext` is installed before the startup hook runs.
138138

139139
> [!NOTE]
@@ -159,7 +159,7 @@ Previously, these commands failed with `Could not find project or directory ''`
159159

160160
The `Using launch settings from ...` informational message now writes to `stderr` instead of `stdout`. Scripts that capture the standard output of `dotnet run` no longer need to strip this line out.
161161

162-
## Asset Groups for Static Web Assets
162+
## Asset groups for static web assets
163163

164164
The Static Web Assets SDK adds support for **Asset Groups**, a way to declare groups of related assets that share publish, fingerprinting, and endpoint metadata. The related `DefineStaticWebAssetEndpoints` task gains an `AdditionalEndpointDefinitions` parameter, and the glob matcher exposes the captured `**` stem so additional endpoints (for example default-document routes like `/` for `**/index.html`) can be defined declaratively.
165165

@@ -171,7 +171,7 @@ The `dotnet` CLI now uses OpenTelemetry (OTel) with Azure Monitor and OTLP expor
171171

172172
## NativeAOT entry point for the dotnet CLI
173173

174-
To enable near-instant startup for common CLI invocations, Preview 4 lays the groundwork for a NativeAOT-compiled `dotnet` CLI host. The work introduces three layers:
174+
To enable near-instant startup for common CLI invocations, .NET 11 lays the groundwork for a NativeAOT-compiled `dotnet` CLI host. The work introduces three layers:
175175

176176
- `dn.exe` — a NativeAOT host that resolves `DOTNET_ROOT` and `hostfxr` and marshals arguments into a NativeAOT shared library. This is for SDK-repository dogfooding, not production usage.
177177
- `dotnet-aot.dll` — a NativeAOT shared library that handles simple commands such as `--version` and `--info` directly, and falls back to the full managed CLI for everything else.
@@ -193,7 +193,7 @@ A new MSBuild property lets upstack tooling (for example, `dotnet/macios` and `d
193193

194194
## Breaking changes
195195

196-
.NET 11 includes the following breaking changes in the SDK:
196+
.NET 11 includes some breaking changes in the SDK.
197197

198198
### Mono launch target no longer set automatically
199199

0 commit comments

Comments
 (0)