Skip to content

Commit 4fa9a7a

Browse files
author
Cam Soper
authored
Update What's New for .NET 10 with P3 info (#45765)
* Update What's New for .NET 10 with P3 info Fixes #45656 * lint * Preview 3, d'oh! * sentence case * Review feedback
1 parent 1c3df3b commit 4fa9a7a

File tree

4 files changed

+168
-21
lines changed

4 files changed

+168
-21
lines changed

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

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
title: What's new in .NET libraries for .NET 10
33
description: Learn about the new .NET libraries features introduced in .NET 10.
44
titleSuffix: ""
5-
ms.date: 03/18/2025
5+
ms.date: 04/09/2025
66
ms.topic: whats-new
77
ai-usage: ai-assisted
88
---
99

1010
# What's new in .NET libraries for .NET 10
1111

12-
This article describes new features in the .NET libraries for .NET 10. It's updated for Preview 2.
12+
This article describes new features in the .NET libraries for .NET 10. It's updated for Preview 3.
1313

1414
## Find certificates by thumbprints other than SHA-1
1515

@@ -133,7 +133,7 @@ When you use source generators for JSON serialization, the generated context thr
133133

134134
## More left-handed matrix transformation methods
135135

136-
.NET 10 adds the remaining APIs for creating left-handed transformation matrices for billboard and constrained-billboard matrices. You can use these methods like their existing right-handed counterparts [add xrefs to the existing counterparts] when using a left-handed coordinate system instead.
136+
.NET 10 adds the remaining APIs for creating left-handed transformation matrices for billboard and constrained-billboard matrices. You can use these methods like their existing right-handed counterparts <xref:System.Numerics.Matrix4x4.CreateBillboard(System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Vector3)> and <xref:System.Numerics.Matrix4x4.CreateConstrainedBillboard(System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Vector3)> when using a left-handed coordinate system instead.
137137

138138
```csharp
139139
public partial struct Matrix4x4
@@ -150,3 +150,68 @@ The new `ExportPkcs12` <!--TODO: add xref --> methods on <xref:System.Security.C
150150
which produces an output supported by almost every library/platform that supports reading PKCS#12/PFX by choosing an older encryption algorithm. `Pkcs12ExportPbeParameters.Pbes2Aes256Sha256` <!--TODO: add xref --> indicates that AES should be used instead of 3DES (and SHA-2-256 instead of SHA-1), but the output may not be understood by all readers (such as Windows XP).
151151

152152
Callers who want even more control can instead utilize the overload that accepts a <xref:System.Security.Cryptography.PbeParameters>.
153+
154+
## New AOT-safe constructor for `ValidationContext`
155+
156+
The <xref:System.ComponentModel.DataAnnotations.ValidationContext> class, used during options validation, now includes a new constructor that explicitly accepts the `displayName` parameter. This ensures AOT safety, allowing its use in native builds without warnings:
157+
158+
```csharp
159+
public sealed class ValidationContext
160+
{
161+
public ValidationContext(object instance,
162+
string displayName,
163+
IServiceProvider? serviceProvider = null,
164+
IDictionary<object, object?>? items = null);
165+
}
166+
```
167+
168+
## Support for telemetry schema URLs in `ActivitySource` and `Meter`
169+
170+
<xref:System.Diagnostics.ActivitySource> and <xref:System.Diagnostics.Metrics.Meter> now support specifying a telemetry schema URL during construction, aligning with OpenTelemetry specifications. This ensures consistency and compatibility for tracing and metrics data. Additionally, the update introduces `ActivitySourceOptions`, simplifying the creation of <xref:System.Diagnostics.ActivitySource> instances with multiple configuration options.
171+
172+
```csharp
173+
public sealed partial class ActivitySource
174+
{
175+
public ActivitySource(ActivitySourceOptions options);
176+
public string? TelemetrySchemaUrl { get; }
177+
}
178+
179+
public class ActivitySourceOptions
180+
{
181+
public ActivitySourceOptions(string name);
182+
public string Name { get; set; }
183+
public string? Version { get; set; }
184+
public IEnumerable<KeyValuePair<string, object?>>? Tags { get; set; }
185+
public string? TelemetrySchemaUrl { get; set; }
186+
}
187+
188+
public partial class Meter : IDisposable
189+
{
190+
public string? TelemetrySchemaUrl { get; }
191+
}
192+
```
193+
194+
## Byte-level support in BPE tokenizer
195+
196+
The <xref:Microsoft.ML.Tokenizers.BpeTokenizer> now supports byte-level encoding, enabling compatibility with models like DeepSeek. This enhancement processes vocabulary as UTF-8 bytes. In addition, the new `BpeOptions` type simplifies tokenizer configuration.
197+
198+
```csharp
199+
BpeOptions bpeOptions = new BpeOptions(vocabs);
200+
BpeTokenizer tokenizer = BpeTokenizer.Create(bpeOptions);
201+
```
202+
203+
## Deterministic option for LightGBM trainer in ML.NET
204+
205+
LightGBM trainers now expose options for deterministic training, ensuring consistent results with the same data and random seed. These options include `deterministic`, `force_row_wise`, and `force_col_wise`.
206+
207+
```csharp
208+
LightGbmBinaryTrainer trainer = ML.BinaryClassification.Trainers.LightGbm(new LightGbmBinaryTrainer.Options
209+
{
210+
Deterministic = true,
211+
ForceRowWise = true
212+
});
213+
```
214+
215+
## Tensor enhancements
216+
217+
The <xref:System.Numerics.Tensors.Tensor> class now includes a nongeneric interface for operations like accessing `Lengths` and `Strides`. Slice operations no longer copy data, improving performance. Additionally, data can be accessed nongenerically by boxing to `object` when performance isn't critical.

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

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
title: What's new in .NET 10
33
description: Learn about the new features introduced in .NET 10 for the runtime, libraries, and SDK. Also find links to what's new in other areas, such as ASP.NET Core.
44
titleSuffix: ""
5-
ms.date: 03/18/2025
5+
ms.date: 04/09/2025
66
ms.topic: whats-new
77
ai-usage: ai-assisted
88
---
99

1010
# What's new in .NET 10
1111

12-
Learn about the new features in .NET 10 and find links to further documentation. This page is updated for Preview 2.
12+
Learn about the new features in .NET 10 and find links to further documentation. This page is updated for Preview 3.
1313

1414
.NET 10, the successor to [.NET 9](../dotnet-9/overview.md), is [supported for three years](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) as a long-term support (LTS) release. You can [download .NET 10 here](https://get.dot.net/10).
1515

@@ -82,13 +82,21 @@ The ASP.NET Core 10.0 release introduces several new features and enhancements,
8282
- **Minimal APIs**:
8383
- Improved integration testing for apps using top-level statements.
8484
- Empty strings in form posts are now treated as `null` for nullable value types.
85+
- Built-in validation support for query, header, route parameters, and request bodies, with customizable behavior.
8586

8687
- **Authentication and authorization**:
8788
- Added new metrics for authentication and authorization events.
8889

8990
- **Miscellaneous**:
9091
- Added the `RedirectHttpResult.IsLocalUrl` helper method for detecting local URLs.
9192
- Added support for route syntax highlighting in the <xref:Microsoft.AspNetCore.Components.RouteAttribute>.
93+
- New `TypedResults.ServerSentEvents` API for streaming event messages to clients in minimal APIs and controller-based apps.
94+
- Declarative state persistence simplifies state persistence in components and services during prerendering using the `SupplyParameterFromPersistentComponentState` attribute.
95+
- Standalone Blazor WebAssembly apps now support referencing fingerprinted static web assets and import maps.
96+
- <xref:System.Net.Http.HttpClient> response streaming is enabled by default on WebAssembly, improving performance and reducing memory usage for large responses.
97+
- The app context switch `DisableMatchAllIgnoresLeftUriPart` is now renamed to `EnableMatchAllForQueryStringAndFragment`.
98+
- Specify the environment for standalone Blazor WebAssembly apps at build time using the `<WasmApplicationEnvironmentName>` property.
99+
- The ASP.NET Core Web API (native AOT) template now includes OpenAPI support by default.
92100

93101
For more information, see [What's new in ASP.NET Core for .NET 10](/aspnet/core/release-notes/aspnetcore-10.0).
94102

@@ -102,6 +110,8 @@ C# 14 introduces several new features and enhancements to improve developer prod
102110
- **Modifiers on simple lambda parameters**: Allows parameter modifiers like `ref`, `in`, or `out` in lambda expressions without specifying parameter types.
103111
- **Experimental feature - String literals in data section**: Enables emitting string literals as UTF-8 data into a separate section of the PE file, improving efficiency for certain scenarios.
104112
- **Partial events and constructors**: Adds support for partial instance constructors and partial events, complementing partial methods and properties introduced in C# 13.
113+
- **Extension members**: Extension methods now support static methods, instance properties, and static properties through `extension` blocks, enabling more flexible and powerful extensions.
114+
- **Null-conditional assignment**: Simplifies conditional assignments by allowing properties or fields to be updated only if the containing instance exists, using the `?.` operator.
105115

106116
For more information, see [What's new in C# 14](../../../csharp/whats-new/csharp-14.md).
107117

@@ -116,10 +126,19 @@ The .NET MAUI updates in .NET 10 include several new features and quality improv
116126
- Added `Switch.OffColor` for customizing the color of the `Switch` control when off.
117127
- Added `SearchBar.SearchIconColor` for customizing the search icon color.
118128
- New `HybridWebView.InvokeJavascriptAsync` method for invoking JavaScript without requiring generic arguments.
129+
- Support for fullscreen video playback in `WebView` on Android when the `iframe` includes `allowfullscreen`.
130+
- Added `Geolocation.IsEnabled` to check if geolocation services are enabled without requesting location details.
131+
- A `CancellationToken` can now be passed to `WebAuthenticator.AuthenticateAsync` for programmatically canceling authentication.
119132

120133
- **Deprecations**:
121134
- The `FontImageExtension` XAML markup extension is deprecated. Use `FontImageSource` instead.
122135
- `MessagingCenter` is now internal. Replace it with `WeakReferenceMessenger` from the `CommunityToolkit.Mvvm` package.
136+
- Deprecation of `ListView`, `Cell`, and `TableView`, which will be removed in a future release.
137+
138+
- **Performance improvements**:
139+
- Property mapping improvements with new caching and optimized property application order, reducing race conditions and repetitive calls.
140+
- CollectionView optimizations on iOS, eliminating `MeasureInvalidated` subscriptions and improving templated cell responsiveness.
141+
- Optimized `Label` rendering for `FormattedString` on Windows, achieving a ~56% performance improvement.
123142

124143
- **.NET for Android**:
125144
- Support for Android 16 (API-36) Beta 1.
@@ -132,6 +151,7 @@ The .NET MAUI updates in .NET 10 include several new features and quality improv
132151
- **.NET for iOS, Mac Catalyst, macOS, tvOS**:
133152
- Trimmer warnings are now enabled by default.
134153
- Bundling of original resources in libraries is now opt-out.
154+
- Support for Xcode 16.3 Release Candidate
135155

136156
For more information, see [What's new in .NET MAUI in .NET 10](/dotnet/maui/whats-new/dotnet-10).
137157

@@ -152,10 +172,18 @@ The EF Core 10 release introduces several new features and improvements, includi
152172
- Enhanced performance for `Count` operations on `ICollection<T>`.
153173
- Optimized `MIN`/`MAX` operations over `DISTINCT`.
154174

175+
- **Improved experience with Azure Cosmos DB for NoSQL**:
176+
- EF Core now materializes a default value for required properties when no data is present in the document, simplifying model evolution.
177+
178+
- **Small improvements**:
179+
- Redacted inlined constants from logs when sensitive logging is off.
180+
- Enhanced <xref:Microsoft.Data.Sqlite.SqliteConnection.LoadExtension(System.String,System.String)> to work correctly with `dotnet run` and libraries named with `lib*`.
181+
155182
- **Miscellaneous**:
156183
- Simplified parameter names in SQL queries (for example, from `@__city_0` to `city`).
157184
- Added translation for date/time functions using `DatePart.Microsecond` and `DatePart.Nanosecond`.
158185
- Made SQL Server scaffolding compatible with Azure Data Explorer.
186+
- Additional minor bug fixes and improvements.
159187

160188
For more information, see [What's new in EF Core for .NET 10](/ef/core/what-is-new/ef-core-10.0/whatsnew).
161189

@@ -211,19 +239,21 @@ The WPF updates in .NET 10 include several performance improvements, Fluent styl
211239
- Replaced data structures like `PartialList` with `ReadOnlyCollection` to enhance performance.
212240
- Optimized UI automation and file dialog operations to minimize allocations.
213241
- Improved pixel format conversion performance.
242+
- Enhanced performance by optimizing cache operations and array handling.
243+
- Migrated font collection loader to managed code.
214244

215245
- **Fluent style changes**:
216246
- Updated the default style for `Label`.
217247
- Fixed animation issues for `Expander` by adjusting a `KeyTime` value.
248+
- Introduced new Fluent styles for controls, including `NavigationWindow`, `Frame`, `ToolBar`, `ResizeGrip`, `GroupBox`, `Hyperlink`, `GridSplitter`, and `Thumb`.
249+
- Fixed elevation border brushes for various controls.
250+
- Corrected missing `RecognizesAccessKey` property.
218251

219252
- **Bug fixes**:
220253
- Resolved issues with UI element cursor types and crashes when bitmap streams are null.
221254
- Fixed localization issues for `ScrollViewer` and `ContextMenu`.
222255
- Addressed minor bugs in `BitmapMetadata` and native dependencies.
223-
224-
- **Engineering health**:
225-
- Updated and synchronized **MilCodeGen** across WPF components.
226-
- Removed deprecated .NET runtime references and unnecessary package dependencies.
227-
- Conducted style cleanups and disabled code analysis for generated code to streamline builds.
256+
- Addressed memory leaks, control behavior anomalies, and property recognition issues.
257+
- Fixed faulty caching of `LinearGradientBrushes` when `RelativeTransform` was used with `Absolute` mapping mode.
228258

229259
For more information, see [What's new in WPF in .NET 10](/dotnet/desktop/wpf/whats-new/net100).

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

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
title: What's new in .NET 10 runtime
33
description: Learn about the new .NET features introduced in the .NET 10 runtime.
44
titleSuffix: ""
5-
ms.date: 03/18/2025
5+
ms.date: 04/09/2025
66
ms.topic: whats-new
77
ai-usage: ai-assisted
88
---
99
# What's new in the .NET 10 runtime
1010

11-
This article describes new features and performance improvements in the .NET runtime for .NET 10. It's updated for Preview 2.
11+
This article describes new features and performance improvements in the .NET runtime for .NET 10. It's updated for Preview 3.
1212

1313
## Array interface method devirtualization
1414

@@ -60,9 +60,9 @@ The JIT can now inline methods that become eligible for devirtualization due to
6060

6161
During inlining, the JIT now updates the type of temporary variables holding return values. If all return sites in a callee yield the same type, this precise type information is used to devirtualize subsequent calls. This enhancement complements the improvements in late devirtualization and array enumeration de-abstraction. For more information, see [dotnet/runtime #111948](https://github.com/dotnet/runtime/pull/111948).
6262

63-
## Stack allocation of arrays of value types
63+
## Stack allocation of small arrays of value types
6464

65-
In .NET 9, the JIT gained the ability to allocate objects on the stack, when the object is guaranteed to not outlive its parent method. Not only does stack allocation reduce the number of objects the GC has to track, but it also unlocks other optimizations. For example, after an object is stack-allocated, the JIT can consider replacing it entirely with its scalar values. Because of this, stack allocation is key to reducing the abstraction penalty of reference types.
65+
In .NET 9, the JIT gained the ability to allocate objects on the stack when the object is guaranteed to not outlive its parent method. Not only does stack allocation reduce the number of objects the GC has to track, but it also unlocks other optimizations. For example, after an object is stack-allocated, the JIT can consider replacing it entirely with its scalar values. Because of this, stack allocation is key to reducing the abstraction penalty of reference types.
6666

6767
In .NET 10, the JIT now stack-allocates small, fixed-sized arrays of value types that don't contain GC pointers when it can make the same lifetime guarantees described previously. Consider the following example:
6868

@@ -83,6 +83,29 @@ static void Sum()
8383

8484
Because the JIT knows `numbers` is an array of only three integers at compile time, and it doesn't outlive a call to `Sum`, it allocates it on the stack.
8585

86+
## Stack allocation of small arrays of reference types
87+
88+
Building on the stack allocation improvements introduced in .NET 9, .NET 10 extends this optimization to small arrays of reference types. Previously, arrays of reference types were always allocated on the heap, even when their lifetime was scoped to a single method. Now, the JIT can stack-allocate such arrays when it determines that they don't outlive their creation context. For example:
89+
90+
```csharp
91+
static void Print()
92+
{
93+
string[] words = {"Hello", "World!"};
94+
foreach (var str in words)
95+
{
96+
Console.WriteLine(str);
97+
}
98+
}
99+
```
100+
101+
In this example, the array `words` is now allocated on the stack, eliminating heap allocations entirely. This reduces GC pressure and improves performance.
102+
103+
## Improved code layout
104+
105+
The JIT compiler in .NET 10 introduces a new approach to organizing method code into basic blocks for better runtime performance. Previously, the JIT used a reverse postorder (RPO) traversal of the program's flowgraph as an initial layout, followed by iterative transformations. While effective, this approach had limitations in modeling the trade-offs between reducing branching and increasing hot code density.
106+
107+
In .NET 10, the JIT models the block reordering problem as a reduction of the asymmetric Travelling Salesman Problem and implements the 3-opt heuristic to find a near-optimal traversal. This optimization improves hot path density and reduces branch distances, resulting in better runtime performance. For more details, see [dotnet/runtime #107749](https://github.com/dotnet/runtime/issues/107749).
108+
86109
## AVX10.2 support
87110

88111
.NET 10 introduces support for the Advanced Vector Extensions (AVX) 10.2 for x64-based processors. The new intrinsics available in the <xref:System.Runtime.Intrinsics.X86.Avx10v2?displayProperty=fullName> class can be tested once capable hardware is available.

0 commit comments

Comments
 (0)