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
Update What's new in .NET 11 for Preview 3 (#53004)
* Initial plan
* Update What's new articles for .NET 11 Preview 3
- Updated all 4 What's new articles for .NET 11 to Preview 3
- Updated ms.date to 04/14/2026 in all files
- runtime.md: simplified Runtime Async opt-in (no EnablePreviewFeatures needed), added NativeAOT/R2R support, added JIT switch folding and uint-float cast improvements, added WebAssembly section
- libraries.md: added System.Text.Json naming/ignore enhancements, Zstandard in System.IO.Compression, ZIP CRC32 validation, SafeFileHandle pipe support, RandomAccess pipe support, Regex AnyNewLine option
- sdk.md: added solution filter CLI support, file-based app #:include, dotnet run -e, dotnet watch improvements, other CLI improvements
- overview.md: updated summaries to reflect Preview 3 features, added union types to C# 15 list
- Updated Libraries.cs snippet with new code samples for Preview 3 features
- Updated Runtime.cs snippet to remove EnablePreviewFeatures comment
Agent-Logs-Url: https://github.com/dotnet/docs/sessions/b44af3f0-172c-4e4f-bb38-d79eed5ce99c
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Fix snippet parameter name
It should be `asyncRead` and `asyncWrite`, not `asyncReads` and `asyncWrites`.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/core/whats-new/dotnet-11/libraries.md
+51-2Lines changed: 51 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,14 @@
2
2
title: What's new in .NET libraries for .NET 11
3
3
description: Learn about the updates to the .NET libraries for .NET 11.
4
4
titleSuffix: ""
5
-
ms.date: 03/10/2026
5
+
ms.date: 04/14/2026
6
6
ai-usage: ai-assisted
7
7
ms.update-cycle: 3650-days
8
8
---
9
9
10
10
# What's new in .NET libraries for .NET 11
11
11
12
-
This article describes new features in the .NET libraries for .NET 11. It was last updated for Preview 2.
12
+
This article describes new features in the .NET libraries for .NET 11. It was last updated for Preview 3.
13
13
14
14
## String and character enhancements
15
15
@@ -61,6 +61,10 @@ The <xref:System.IO.Compression.ZipArchiveEntry> class now supports opening entr
61
61
62
62
Additionally, a new <xref:System.IO.Compression.ZipArchiveEntry.CompressionMethod> property exposes the compression method used for an entry through the <xref:System.IO.Compression.ZipCompressionMethod> enum, which includes values for <xref:System.IO.Compression.ZipCompressionMethod.Stored>, <xref:System.IO.Compression.ZipCompressionMethod.Deflate>, and <xref:System.IO.Compression.ZipCompressionMethod.Deflate64>.
63
63
64
+
### ZIP CRC32 validation
65
+
66
+
Starting in Preview 3, <xref:System.IO.Compression.ZipArchive> validates the CRC32 checksum when reading ZIP entries. Corrupted or truncated archives that previously passed without error now throw <xref:System.IO.InvalidDataException>, helping you detect data integrity issues early.
67
+
64
68
### DeflateStream and GZipStream behavior change
65
69
66
70
Starting in .NET 11, <xref:System.IO.Compression.DeflateStream> and <xref:System.IO.Compression.GZipStream> always write format headers and footers to the output stream, even when no data is written. This ensures the output is a valid compressed stream according to the Deflate and GZip specifications.
@@ -115,6 +119,26 @@ New generic <xref:System.Text.Json.JsonSerializerOptions.GetTypeInfo``1?displayP
115
119
116
120
This is particularly useful when working with source generation, NativeAOT, and polymorphic serialization scenarios where type metadata access is common.
117
121
122
+
### Naming and ignore defaults
123
+
124
+
Preview 3 expands the naming and ignore options available in `System.Text.Json`:
125
+
126
+
-**`JsonNamingPolicy.PascalCase`**: A new built-in naming policy that converts property names to PascalCase. It joins the existing camelCase, snake_case, and kebab-case policies.
127
+
-**Per-member naming policy**: The new `[JsonNamingPolicy]` attribute lets you override the naming policy on individual properties or fields, giving you fine-grained control without a custom converter.
128
+
-**Type-level ignore conditions**: Applying `[JsonIgnore(Condition = ...)]` at the class or struct level sets the default ignore behavior for all members, so you no longer need to repeat the attribute on every nullable property.
The Zstandard compression APIs are now part of the <xref:System.IO.Compression?displayProperty=fullName> namespace, alongside `DeflateStream`, `GZipStream`, and `BrotliStream`. If you referenced the earlier preview package, remove the separate package reference:
New overloads on <xref:System.Formats.Tar.TarFile.CreateFromDirectory*> and <xref:System.Formats.Tar.TarFile.CreateFromDirectoryAsync*> accept a <xref:System.Formats.Tar.TarEntryFormat> parameter, giving you direct control over the archive format. Previously, `CreateFromDirectory` always produced Pax archives. The new overloads support all four tar formats—Pax, Ustar, GNU, and V7—for compatibility with specific tools and environments.
@@ -127,6 +151,31 @@ New overloads on <xref:System.Formats.Tar.TarFile.CreateFromDirectory*> and <xre
127
151
128
152
<xref:System.Numerics.Matrix4x4.GetDeterminant?displayProperty=nameWithType> now uses an SSE-vectorized implementation, improving performance by approximately 15%.
129
153
154
+
## Low-level I/O improvements
155
+
156
+
### SafeFileHandle pipe support
157
+
158
+
<xref:Microsoft.Win32.SafeHandles.SafeFileHandle> gains two new members in Preview 3:
159
+
160
+
-**`Type` property:** Reports whether a handle represents a file, pipe, socket, directory, or other OS object, without requiring platform-specific code.
161
+
-**`CreateAnonymousPipe` method:** Creates a pair of connected anonymous pipe handles with independent async behavior for each end.
<xref:System.IO.RandomAccess.Read*?displayProperty=nameWithType> and <xref:System.IO.RandomAccess.Write*?displayProperty=nameWithType> now work with non-seekable handles such as pipes, in addition to regular file handles.
168
+
169
+
On Windows, `Process` now uses overlapped I/O for redirected stdout/stderr, which reduces thread-pool blocking in process-heavy applications.
170
+
171
+
## Regular expression improvements
172
+
173
+
### AnyNewLine option
174
+
175
+
A new <xref:System.Text.RegularExpressions.RegexOptions> flag, `AnyNewLine`, makes `^`, `$`, and `.` treat the full set of Unicode newline characters as line terminators—not just `\n`. This helps when parsing text that mixes Windows (`\r\n`), Unix (`\n`), and Unicode-specific (`\u0085`, `\u2028`, `\u2029`) line endings.
Copy file name to clipboardExpand all lines: docs/core/whats-new/dotnet-11/overview.md
+14-5Lines changed: 14 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,14 @@
2
2
title: What's new in .NET 11
3
3
description: Learn about the new features introduced in .NET 11 for the runtime, libraries, and SDK. Also find links to what's new in other areas, such as ASP.NET Core.
4
4
titleSuffix: ""
5
-
ms.date: 03/10/2026
5
+
ms.date: 04/14/2026
6
6
ai-usage: ai-assisted
7
7
ms.update-cycle: 3650-days
8
8
---
9
9
10
10
# What's new in .NET 11
11
11
12
-
This article describes new features in .NET 11. It was last updated for Preview 2.
12
+
This article describes new features in .NET 11. It was last updated for Preview 3.
13
13
14
14
.NET 11 is currently in preview. The final release is expected in November 2026. You can [download .NET 11 here](https://dotnet.microsoft.com/download/dotnet/11.0).
15
15
@@ -20,8 +20,9 @@ Your feedback is important and appreciated. If you have questions or comments, u
20
20
The .NET 11 runtime includes:
21
21
22
22
- 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.
24
-
- JIT improvements for bounds check elimination, redundant checked context removal, and new Arm SVE2 intrinsics.
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`.
24
+
- JIT improvements for bounds check elimination, redundant checked context removal, switch expression folding, and new Arm SVE2 intrinsics.
25
+
- WebAssembly improvements, including WebCIL payload loading and better debugging symbols.
25
26
26
27
For more information, see [What's new in the .NET 11 runtime](runtime.md).
27
28
@@ -30,10 +31,13 @@ For more information, see [What's new in the .NET 11 runtime](runtime.md).
30
31
The .NET 11 libraries include new APIs for:
31
32
32
33
- String and character manipulation, including Rune-based operations in <xref:System.String> and BFloat16 support in <xref:System.BitConverter>.
33
-
- Compression, including improved Base64 APIs and new methods for ZIP archive entries.
34
+
- Compression, including improved Base64 APIs, new methods for ZIP archive entries, Zstandard compression in <xref:System.IO.Compression?displayProperty=fullName>, and CRC32 validation when reading ZIP entries.
34
35
- Generic type info retrieval in <xref:System.Text.Json?displayProperty=fullName>.
36
+
- System.Text.Json naming and ignore enhancements, including `JsonNamingPolicy.PascalCase`, per-member naming policy overrides, and type-level ignore conditions.
35
37
- Tar archive format selection.
36
38
- Numerics, including a <xref:System.Numerics.Matrix4x4> performance improvement.
39
+
- Low-level I/O, including `SafeFileHandle` pipe-type reporting and anonymous pipe creation, and `RandomAccess` read/write on non-seekable handles.
40
+
- Regular expression support for all Unicode newline sequences via <xref:System.Text.RegularExpressions.RegexOptions>.
37
41
38
42
For more information, see [What's new in the .NET 11 libraries](libraries.md).
39
43
@@ -45,6 +49,10 @@ The .NET 11 SDK includes:
45
49
- Improved [CA1873](../../../fundamentals/code-analysis/quality-rules/ca1873.md) code analyzer with reduced noise and clearer diagnostic messages.
46
50
- 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).
47
51
- A new NETSDK1235 warning for custom `.nuspec` files used with PackAsTool.
52
+
- Support for creating and editing solution filters (`.slnf`) from the `dotnet sln` CLI.
53
+
- File-based app support for `#:include` to split apps across multiple files.
54
+
- A new `dotnet run -e` option to pass environment variables from the command line.
55
+
-`dotnet watch` improvements, including Aspire app-host integration and automatic crash recovery.
48
56
49
57
For more information, see [What's new in the SDK for .NET 11](sdk.md).
50
58
@@ -57,6 +65,7 @@ For information about what's new in ASP.NET Core, see [What's new in ASP.NET Cor
Starting with Preview 3, a `net11.0` project no longer requires `<EnablePreviewFeatures>true</EnablePreviewFeatures>` to use Runtime Async.
73
+
73
74
### Cleaner live stack traces
74
75
75
76
The most visible improvement is in *live stack traces*—what profilers, debuggers, and `new StackTrace()` see during execution. With compiler-generated async, each async method produces multiple frames from state-machine infrastructure. With Runtime Async, the actual methods appear directly on the call stack.
@@ -109,14 +110,20 @@ The most visible improvement is in *live stack traces*—what profilers, debugge
109
110
110
111
This improvement benefits anything that inspects the live execution stack, including profiling tools, diagnostic logging, and the debugger call stack window.
111
112
113
+
### NativeAOT and ReadyToRun support
114
+
115
+
Preview 3 adds Runtime Async support for NativeAOT and ReadyToRun compilation. This extends the feature beyond JIT-compiled code to ahead-of-time compiled scenarios. The runtime also reuses continuation objects more aggressively and avoids saving unchanged locals, reducing allocation pressure in async-heavy code.
116
+
112
117
### Debugging improvements
113
118
114
119
Breakpoints now bind correctly inside runtime-async methods, and the debugger can step through `await` boundaries without jumping into compiler-generated infrastructure.
115
120
116
121
## JIT improvements
117
122
118
-
-**Bounds check elimination:** The just-in-time (JIT) compiler now eliminates bounds checks for the common pattern where an index plus a constant is compared against a length, such as `i + cns < len`. This reduces redundant checks in tight loops and improves throughput for array and span operations.
123
+
-**Bounds check elimination:** The just-in-time (JIT) compiler now eliminates bounds checks for the common pattern where an index plus a constant is compared against a length, such as `i + cns < len`. It also eliminates more redundant bounds checks for index-from-end access (for example, `values[^1]`). These improvements reduce redundant checks in tight loops and improve throughput for array and span operations.
119
124
-**Redundant checked context removal:** The JIT can now prove and remove redundant checked arithmetic contexts—for example, when a value is already known to be in range. This optimization eliminates unnecessary overflow checks in generated code.
125
+
-**Switch expression folding:** Multi-target `switch` expressions now fold into simpler branchless checks when the targets are a small set of constants, for example `x is 0 or 1 or 2 or 3 or 4`.
126
+
-**Faster uint-to-float/double casts:** Casting `uint` to `float` or `double` is faster on pre-AVX-512 x86 hardware.
120
127
-**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.
121
128
-**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.
122
129
@@ -125,6 +132,14 @@ Breakpoints now bind correctly inside runtime-async methods, and the debugger ca
125
132
-**Cached interface dispatch on non-JIT platforms:** On platforms that lack JIT support, such as iOS, interface dispatch was falling back to an expensive generic fixup path. Cached dispatch yields up to 200x improvements in interface-heavy code on these targets.
126
133
-**`Guid.NewGuid()` on Linux:**<xref:System.Guid.NewGuid?displayProperty=nameWithType> on Linux now uses the `getrandom()` syscall with batch caching instead of reading from `/dev/urandom`, yielding approximately 12% throughput improvement for GUID generation.
127
134
135
+
## WebAssembly improvements
136
+
137
+
Preview 3 expands browser and WebAssembly support with several improvements:
138
+
139
+
-**WebCIL payload loading:** The runtime can now load WebCIL payloads directly, improving compatibility with browser-based deployment scenarios.
140
+
-**Better debugging symbols:** Symbol and stack trace quality for WebAssembly debugging has improved, making it easier to diagnose issues in browser-hosted .NET apps.
141
+
-**`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.
142
+
128
143
## See also
129
144
130
145
-[What's new in .NET libraries for .NET 11](libraries.md)
Copy file name to clipboardExpand all lines: docs/core/whats-new/dotnet-11/sdk.md
+48-2Lines changed: 48 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,14 @@
2
2
title: What's new in the SDK and tooling for .NET 11
3
3
description: Learn about the new .NET SDK features introduced in .NET 11.
4
4
titleSuffix: ""
5
-
ms.date: 03/10/2026
5
+
ms.date: 04/14/2026
6
6
ai-usage: ai-assisted
7
7
ms.update-cycle: 3650-days
8
8
---
9
9
10
10
# What's new in the SDK and tooling for .NET 11
11
11
12
-
This article describes new features and enhancements in the .NET SDK for .NET 11. It was last updated for Preview 2.
12
+
This article describes new features and enhancements in the .NET SDK for .NET 11. It was last updated for Preview 3.
13
13
14
14
## Smaller SDK installers on Linux and macOS
15
15
@@ -80,6 +80,52 @@ warning NETSDK1235: .NET Tools do not support using a custom .nuspec file, but t
80
80
81
81
The pack operation still proceeds with a warning to avoid breaking existing projects.
82
82
83
+
## Solution filter CLI support
84
+
85
+
`dotnet sln` can now create and edit solution filters (`.slnf`) directly from the CLI. Solution filters let large repositories load or build a subset of projects without changing the main solution. The supported operations mirror the existing `dotnet sln` commands:
86
+
87
+
```bash
88
+
dotnet new slnf --name MyApp.slnf
89
+
dotnet sln MyApp.slnf add src/Lib/Lib.csproj
90
+
dotnet sln MyApp.slnf list
91
+
dotnet sln MyApp.slnf remove src/Lib/Lib.csproj
92
+
```
93
+
94
+
## File-based apps split across files
95
+
96
+
File-based apps now support an `#:include` directive, so you can move shared helpers into separate files without giving up the file-based workflow:
`dotnet run -e KEY=VALUE` passes environment variables to the launched app from the command line, without requiring you to export shell state or edit launch profiles:
108
+
109
+
```bash
110
+
dotnet run -e ASPNETCORE_ENVIRONMENT=Development -e LOG_LEVEL=Debug
111
+
```
112
+
113
+
Environment variables passed this way are available to MSBuild logic as `RuntimeEnvironmentVariable` items.
114
+
115
+
## dotnet watch improvements
116
+
117
+
Preview 3 adds several `dotnet watch` improvements for long-running local development loops:
118
+
119
+
-**Aspire integration:**`dotnet watch` can now integrate with Aspire app hosts, enabling hot-reload workflows across the full Aspire application model.
120
+
-**Crash recovery:** When the app crashes, `dotnet watch` automatically relaunches it on the next relevant file change.
121
+
-**Windows desktop support:** Ctrl+C handling is improved for Windows desktop apps such as Windows Forms and WPF.
122
+
123
+
## Other CLI improvements
124
+
125
+
-`dotnet format` now accepts `--framework` for multi-targeted projects.
126
+
-`dotnet test` in Microsoft Testing Platform (MTP) mode now supports `--artifacts-path`.
127
+
-`dotnet tool exec` and `dnx` no longer prompt for an extra approval when running tools.
128
+
83
129
## Breaking changes
84
130
85
131
.NET 11 includes the following breaking change in the SDK:
0 commit comments