From 77fdb45bc7d118d7f4e6f1d7988013c25dfbcb14 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 2 Jul 2025 19:54:56 +0000 Subject: [PATCH 01/45] Initial plan From 63911a8a84d9e3582f345a82536749bb6c7a78d4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 2 Jul 2025 20:00:32 +0000 Subject: [PATCH 02/45] Add ASP.NET Core release notes for .NET 10 Preview 6 Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- .../10.0/preview/preview6/aspnetcore.md | 227 +++++++++++++++++- 1 file changed, 224 insertions(+), 3 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index d5dcf2bff2..2a2e75172f 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -2,7 +2,16 @@ Here's a summary of what's new in ASP.NET Core in this preview release: -- [Feature](#feature) +- [Automatic eviction from memory pool](#automatic-eviction-from-memory-pool) +- [Blazor WebAssembly preloading](#blazor-webassembly-preloading) +- [Blazor build producing javascript bundler friendly output](#blazor-build-producing-javascript-bundler-friendly-output) +- [Improved form validation for Blazor](#improved-form-validation-for-blazor) +- [NotFound works with streaming that has started](#notfound-works-with-streaming-that-has-started) +- [Blazor diagnostics improvements](#blazor-diagnostics-improvements) +- [NavigationException switch behavior change](#navigationexception-switch-behavior-change) +- [Add passkey support to ASP.NET Core Identity](#add-passkey-support-to-aspnet-core-identity) +- [Minimal API Validation integration with IProblemDetailsService](#minimal-api-validation-integration-with-iproblemdetailsservice) +- [Unified validation APIs moved to extensions package](#unified-validation-apis-moved-to-extensions-package) ASP.NET Core updates in .NET 10: @@ -10,6 +19,218 @@ ASP.NET Core updates in .NET 10: - [Breaking changes](https://docs.microsoft.com/dotnet/core/compatibility/10.0#aspnet-core) - [Roadmap](https://github.com/dotnet/aspnetcore/issues/59443) -## Feature +## Automatic eviction from memory pool -Something about the feature +The memory pools used by Kestrel, IIS, and HTTP.sys now automatically evict memory blocks when the application is idle or under less load, helping applications use resources more efficiently. + +**Why it matters:** +Previously, memory allocated by the pool would remain reserved, even when not in use. With this enhancement, when the app is idle for a period of time, memory is now released back to the system, reducing overall memory usage and helping applications stay responsive under varying workloads. + +**How to use:** +No action is needed to benefit from this feature. Memory eviction is handled automatically by the framework. + +There are also metrics added to the default memory pool used by our server implementations. The new metrics are under the name `"Microsoft.AspNetCore.MemoryPool"`. See the [ASP.NET Core metrics documentation](https://learn.microsoft.com/aspnet/core/log-mon/metrics/metrics?view=aspnetcore-9.0) for general information on what metrics are and how to use them. + +You can also use the memory pool in custom scenarios: + +```csharp +public class MyBackgroundService : BackgroundService +{ + private readonly MemoryPool _memoryPool; + + public MyBackgroundService(IMemoryPoolFactory factory) + { + _memoryPool = factory.CreatePool(); + } + + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + while (!stoppingToken.IsCancellationRequested) + { + try + { + await Task.Delay(20, stoppingToken); + // do work that needs memory + var rented = _memoryPool.Rent(100); + rented.Dispose(); + } + catch (OperationCanceledException) + { + return; + } + } + } +} +``` + +Or replace the memory pool being used: + +```csharp +services.AddSingleton, CustomMemoryPoolFactory>(); + +public class CustomMemoryPoolFactory : IMemoryPoolFactory +{ + public MemoryPool Create() + { + // Return a custom MemoryPool implementation or the default. + return MemoryPool.Shared; + } +} +``` + +## Blazor WebAssembly preloading + +Blazor WebAssembly applications now use a `` component instead of link headers for preloading WebAssembly assets. This allows the framework to correctly identify the Blazor application root using `` and provides better control over the preloading behavior. + +To use this feature, place the `` component near the base tag in your application: + +```diff + ++ +``` + +Removing the component will disable the preloading feature, which is useful in cases where the application uses `loadBootResource` callback to modify URLs. + +## Blazor build producing javascript bundler friendly output + +The default Blazor build output is now compatible with tools like webpack or rollup when you set `WasmBundlerFriendlyBootConfig=true`. This output is not directly runnable in the browser, but it can be consumed by JavaScript bundlers to combine with other user scripts. + +```xml + + true + +``` + +This setup works for publish scenarios because during Blazor build, files are served from multiple locations to minimize file writes. + +## Improved form validation for Blazor + +Blazor now has improved form validation capabilities including support for validating properties of nested objects and collection items. + +To create a validated form, use a `DataAnnotationsValidator` component inside an `EditForm` component, just as before. To opt into the new validation feature, do the following: + +1. Call the `AddValidation` extension method in your application setup. +2. Declare the form model types in a .cs file (i.e., not a .razor file). +3. Annotate the root form model type with the `[ValidatableType]` attribute. + +Without these steps, the validation behavior remains the same as in previous versions. + +Here's an example: + +```csharp +// Program.cs +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddRazorComponents(); + +// This line enables the new validation behavior. +builder.Services.AddValidation(); +``` + +```csharp +// Data/OrderModel.cs + +// This attribute is needed on the top-level model type. +// The other types are discovered automatically. +[ValidatableType] +public class OrderModel +{ + public CustomerModel CustomerDetails { get; set; } = new CustomerModel(); + public List OrderItems { get; set; } = new List(); +} + +public class CustomerModel +{ + [Required(ErrorMessage = "Name is required.")] + public string? FullName { get; set; } + + [Required(ErrorMessage = "Email is required.")] + [EmailAddress(ErrorMessage = "Invalid email address.")] + public string? Email { get; set; } + + public AddressModel ShippingAddress { get; set; } = new AddressModel(); +} +``` + +```razor +@* Pages/Order.razor *@ + + + + +

Customer Details

+
+ + + +
+ + @* ... *@ +
+ +@code { + private OrderModel order = new OrderModel(); +} +``` + +The requirement to declare model types outside of `.razor` files is due to the fact that both the validation feature and the Razor compiler use source generators. Currently, output of one source generator cannot be used as input for another source generator. + +## NotFound works with streaming that has started + +Blazor now supports calling `NotFound()` even when streaming has already started. This improvement allows for better error handling in scenarios where content has already begun streaming to the client but a not-found condition is later encountered. + +## Blazor diagnostics improvements + +All Blazor traces are now top level in the Aspire dashboard and in Application Insights, instead of being nested under HTTP or SignalR parent traces. Additionally, the `CircuitStart` trace has been moved to a separate `Microsoft.AspNetCore.Components.Server.Circuits` source. + +To configure OpenTelemetry for the new trace sources: + +```diff +builder.Services.ConfigureOpenTelemetryTracerProvider(tracerProvider => +{ + tracerProvider.AddSource("Microsoft.AspNetCore.Components"); ++ tracerProvider.AddSource("Microsoft.AspNetCore.Components.Server.Circuits"); +}); +``` + +## NavigationException switch behavior change + +The default behavior for `NavigationException` has changed. The configuration switch has been renamed and its default value updated: + +```diff +- "Microsoft.AspNetCore.Components.Endpoints.NavigationManager.EnableThrowNavigationException", default value: false ++ "Microsoft.AspNetCore.Components.Endpoints.NavigationManager.DisableThrowNavigationException", default value: true +``` + +This change improves the default navigation behavior in Blazor applications. + +## Add passkey support to ASP.NET Core Identity + +Passkeys are a modern, phishing-resistant authentication method that improves security and user experience by leveraging public key cryptography and device-based authentication. ASP.NET Core Identity now supports passkey authentication based on WebAuthn and FIDO2 standards. This feature allows users to sign in without passwords, using secure, device-based authentication methods like biometrics or security keys. + +The Blazor Web App template provides out-of-the-box passkey management and login functionality. + +Developers can use new APIs to enable and manage passkey authentication in existing apps. + +## Minimal API Validation integration with IProblemDetailsService + +Error responses from the validation logic for minimal APIs can now be customized by an `IProblemDetailsService` implementation provided in the application services collection (DI container). This enables more consistent and user-specific error responses in an ASP.NET Core application. + +Community contribution from [@marcominerva](https://github.com/marcominerva). Thank you! + +## Unified validation APIs moved to extensions package + +The validation APIs have been moved to the `Microsoft.Extensions.Validation` namespace/NuGet package, making them usable outside of ASP.NET Core HTTP scenarios. The public APIs and their behavior remain the same, just under a new package and namespace. Existing projects should not require code changes; old references will redirect to the new implementation. + +## Contributors + +Thank you contributors! ❤️ + +- [@am11](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Aam11) +- [@BrennanConroy](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3ABrennanConroy) +- [@guardrex](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Aguardrex) +- [@ilonatommy](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Ailonatommy) +- [@maraf](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amaraf) +- [@marcominerva](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amarcominerva) +- [@mikekistler](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amikekistler) +- [@oroztocil](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Aoroztocil) +- [@pavelsavara](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Apavelsavara) From 8857e67c79d847ab1b260340523b88049e10a247 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 2 Jul 2025 22:46:11 +0000 Subject: [PATCH 03/45] Update memory pool metrics documentation per review feedback Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 2a2e75172f..71b50ef817 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -29,7 +29,7 @@ Previously, memory allocated by the pool would remain reserved, even when not in **How to use:** No action is needed to benefit from this feature. Memory eviction is handled automatically by the framework. -There are also metrics added to the default memory pool used by our server implementations. The new metrics are under the name `"Microsoft.AspNetCore.MemoryPool"`. See the [ASP.NET Core metrics documentation](https://learn.microsoft.com/aspnet/core/log-mon/metrics/metrics?view=aspnetcore-9.0) for general information on what metrics are and how to use them. +There are also metrics added to the default memory pool used by our server implementations. The new metrics are under the name `Microsoft.AspNetCore.MemoryPool`. See the [ASP.NET Core metrics documentation](https://learn.microsoft.com/aspnet/core/log-mon/metrics/metrics) for general information on what metrics are and how to use them. You can also use the memory pool in custom scenarios: From e283172cda326116af4bf2086aaf312c8fa134dd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 2 Jul 2025 23:04:53 +0000 Subject: [PATCH 04/45] Fix memory pool factory method name in code example Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 71b50ef817..711129ead0 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -40,7 +40,7 @@ public class MyBackgroundService : BackgroundService public MyBackgroundService(IMemoryPoolFactory factory) { - _memoryPool = factory.CreatePool(); + _memoryPool = factory.Create(); } protected override async Task ExecuteAsync(CancellationToken stoppingToken) From 8894ae3b48f5c81f95cada7f60924d87fa1204a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 2 Jul 2025 23:12:45 +0000 Subject: [PATCH 05/45] Update memory pool description to mention IMemoryPoolFactory service interface Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 711129ead0..3ad62ae0ad 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -31,7 +31,7 @@ No action is needed to benefit from this feature. Memory eviction is handled aut There are also metrics added to the default memory pool used by our server implementations. The new metrics are under the name `Microsoft.AspNetCore.MemoryPool`. See the [ASP.NET Core metrics documentation](https://learn.microsoft.com/aspnet/core/log-mon/metrics/metrics) for general information on what metrics are and how to use them. -You can also use the memory pool in custom scenarios: +You can also use the memory pool in custom scenarios by using the new `IMemoryPoolFactory` service interface: ```csharp public class MyBackgroundService : BackgroundService From eeb814df92ad6601b97c61451c17a4f0a3ab10b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 2 Jul 2025 23:15:01 +0000 Subject: [PATCH 06/45] Update memory pool replacement description per review feedback Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 3ad62ae0ad..bdbca0bf8a 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -63,7 +63,7 @@ public class MyBackgroundService : BackgroundService } ``` -Or replace the memory pool being used: +Use a custom `IMemoryPoolFactory` to replace the memory pool being used: ```csharp services.AddSingleton, CustomMemoryPoolFactory>(); From 6ebdc55df532a352716e1a23c27a337ff3e9c310 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 2 Jul 2025 23:17:02 +0000 Subject: [PATCH 07/45] Update Blazor WebAssembly preloading description per review feedback Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index bdbca0bf8a..a0e6e12017 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -80,7 +80,7 @@ public class CustomMemoryPoolFactory : IMemoryPoolFactory ## Blazor WebAssembly preloading -Blazor WebAssembly applications now use a `` component instead of link headers for preloading WebAssembly assets. This allows the framework to correctly identify the Blazor application root using `` and provides better control over the preloading behavior. +Blazor WebAssembly applications now use a `` component instead of link headers for preloading WebAssembly assets. This allows the framework to correctly identify the Blazor application base URL and provides better control over the preloading behavior. To use this feature, place the `` component near the base tag in your application: From 47e72fdfe158485a4b2cad3abb0394fb44ff3be1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 2 Jul 2025 23:19:04 +0000 Subject: [PATCH 08/45] Address feedback on LinkPreload component documentation Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- release-notes/10.0/preview/preview6/aspnetcore.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index a0e6e12017..8eb52dd05f 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -82,14 +82,14 @@ public class CustomMemoryPoolFactory : IMemoryPoolFactory Blazor WebAssembly applications now use a `` component instead of link headers for preloading WebAssembly assets. This allows the framework to correctly identify the Blazor application base URL and provides better control over the preloading behavior. -To use this feature, place the `` component near the base tag in your application: +To use this feature, place the `` component in the head of your application: ```diff + ``` -Removing the component will disable the preloading feature, which is useful in cases where the application uses `loadBootResource` callback to modify URLs. +Removing the component will disable the preloading feature, which is useful in cases where the application uses the `loadBootResource` callback to modify URLs. ## Blazor build producing javascript bundler friendly output From a613d505de25e9c1d70836d84fcb1f2d91801d5d Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 2 Jul 2025 16:20:25 -0700 Subject: [PATCH 09/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 8eb52dd05f..201459b0f4 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -93,7 +93,7 @@ Removing the component will disable the preloading feature, which is useful in c ## Blazor build producing javascript bundler friendly output -The default Blazor build output is now compatible with tools like webpack or rollup when you set `WasmBundlerFriendlyBootConfig=true`. This output is not directly runnable in the browser, but it can be consumed by JavaScript bundlers to combine with other user scripts. +The default Blazor build output is now compatible with tools like webpack or rollup when you set the `WasmBundlerFriendlyBootConfig` MSBuild property to `true`. This output is not directly runnable in the browser, but it can be consumed by JavaScript bundlers to combine with other user scripts. ```xml From b03c9646b7e4d8cd087c8a6b94bcf9cedb9e9e7d Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 2 Jul 2025 16:36:58 -0700 Subject: [PATCH 10/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 201459b0f4..9554de8494 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -31,7 +31,7 @@ No action is needed to benefit from this feature. Memory eviction is handled aut There are also metrics added to the default memory pool used by our server implementations. The new metrics are under the name `Microsoft.AspNetCore.MemoryPool`. See the [ASP.NET Core metrics documentation](https://learn.microsoft.com/aspnet/core/log-mon/metrics/metrics) for general information on what metrics are and how to use them. -You can also use the memory pool in custom scenarios by using the new `IMemoryPoolFactory` service interface: +You can also use the new `IMemoryPoolFactory` service interface to create or access memory pools for custom scenarios: ```csharp public class MyBackgroundService : BackgroundService From 1d1ecff09cbf2a7ebd55b9164569b5974d20899b Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 2 Jul 2025 16:45:17 -0700 Subject: [PATCH 11/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 9554de8494..415473c86b 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -85,9 +85,11 @@ Blazor WebAssembly applications now use a `` component instead of To use this feature, place the `` component in the head of your application: ```diff - -+ -``` + + ++ + ... + Removing the component will disable the preloading feature, which is useful in cases where the application uses the `loadBootResource` callback to modify URLs. From 62a9b9bc2f7715fb0309f3dbf3ac80007ebb80c7 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 2 Jul 2025 16:45:28 -0700 Subject: [PATCH 12/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 415473c86b..972c76be1c 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -95,7 +95,7 @@ Removing the component will disable the preloading feature, which is useful in c ## Blazor build producing javascript bundler friendly output -The default Blazor build output is now compatible with tools like webpack or rollup when you set the `WasmBundlerFriendlyBootConfig` MSBuild property to `true`. This output is not directly runnable in the browser, but it can be consumed by JavaScript bundlers to combine with other user scripts. +The Blazor build output is now compatible with tools like webpack or rollup when you set the `WasmBundlerFriendlyBootConfig` MSBuild property to `true`. This output is not directly runnable in the browser, but it can be consumed by JavaScript bundlers to combine with other user scripts. ```xml From 1820d53559010ee3e872dd5c6eb377a7bb8aa59f Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 2 Jul 2025 16:46:10 -0700 Subject: [PATCH 13/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 1 + 1 file changed, 1 insertion(+) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 972c76be1c..9d2bebcc10 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -90,6 +90,7 @@ To use this feature, place the `` component in the head of your a + ... +``` Removing the component will disable the preloading feature, which is useful in cases where the application uses the `loadBootResource` callback to modify URLs. From 799ac3404c85832f8b197ba7a3fd9e1c8706c3fa Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Thu, 3 Jul 2025 08:39:59 -0700 Subject: [PATCH 14/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 9d2bebcc10..6c0efc7887 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -116,7 +116,7 @@ To create a validated form, use a `DataAnnotationsValidator` component inside an 2. Declare the form model types in a .cs file (i.e., not a .razor file). 3. Annotate the root form model type with the `[ValidatableType]` attribute. -Without these steps, the validation behavior remains the same as in previous versions. +Without these steps, the validation behavior remains the same as in previous versions where only the top-level type is validated. Here's an example: From 21f33dc98e52af0f124df9be2042da08a6830904 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 08:46:26 -0700 Subject: [PATCH 15/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 6c0efc7887..cdad160aaa 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -80,7 +80,7 @@ public class CustomMemoryPoolFactory : IMemoryPoolFactory ## Blazor WebAssembly preloading -Blazor WebAssembly applications now use a `` component instead of link headers for preloading WebAssembly assets. This allows the framework to correctly identify the Blazor application base URL and provides better control over the preloading behavior. +Blazor now provides a `` component to generate `link` tags instead of using link headers to preload framework assets. This allows the framework to correctly identify the Blazor application base URL and provides better control over the preloading behavior. To use this feature, place the `` component in the head of your application: From fcad02bd2e0f0603712cfcad350c5ea29e834fa4 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 09:35:10 -0700 Subject: [PATCH 16/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index cdad160aaa..ca043e0b3d 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -96,7 +96,7 @@ Removing the component will disable the preloading feature, which is useful in c ## Blazor build producing javascript bundler friendly output -The Blazor build output is now compatible with tools like webpack or rollup when you set the `WasmBundlerFriendlyBootConfig` MSBuild property to `true`. This output is not directly runnable in the browser, but it can be consumed by JavaScript bundlers to combine with other user scripts. +Set the new `WasmBundlerFriendlyBootConfig` MSBuild property to `true` to make the Blazor WebAssembly build output compatible with tools like webpack or rollup. Setting this property will adjust the .NET boot configuration to explicitly import framework assets. This output is not directly runnable in the browser, but it can be consumed by JavaScript bundlers to combine it with other scripts. ```xml From 7ffcef7743b2c95caa3c6d02c3368efd87d674e0 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 09:38:45 -0700 Subject: [PATCH 17/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index ca043e0b3d..cd128c3bf2 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -96,7 +96,7 @@ Removing the component will disable the preloading feature, which is useful in c ## Blazor build producing javascript bundler friendly output -Set the new `WasmBundlerFriendlyBootConfig` MSBuild property to `true` to make the Blazor WebAssembly build output compatible with tools like webpack or rollup. Setting this property will adjust the .NET boot configuration to explicitly import framework assets. This output is not directly runnable in the browser, but it can be consumed by JavaScript bundlers to combine it with other scripts. +Set the new `WasmBundlerFriendlyBootConfig` MSBuild property to `true` to make the Blazor WebAssembly build output compatible with tools like webpack or rollup. ```xml @@ -104,7 +104,7 @@ Set the new `WasmBundlerFriendlyBootConfig` MSBuild property to `true` to make t ``` -This setup works for publish scenarios because during Blazor build, files are served from multiple locations to minimize file writes. +Setting this property will adjust the .NET boot configuration to explicitly import framework assets. The output won't be directly runnable in the browser, but the project's published out can be consumed by JavaScript bundlers to combine it with other scripts. ## Improved form validation for Blazor From 28e71e7bc25da6243d30c6b335222fefff877f90 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 09:46:34 -0700 Subject: [PATCH 18/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index cd128c3bf2..acd17f732b 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -118,6 +118,8 @@ To create a validated form, use a `DataAnnotationsValidator` component inside an Without these steps, the validation behavior remains the same as in previous versions where only the top-level type is validated. +Note that the `[ValidatableType]` attribute is currently experimental and is subject to change, so using this attribute will result in a build error. You'll need to suppress this diagnostic to try out the feature. + Here's an example: ```csharp From df25d41fccf38107e309cc7069a9bf7bcda8c62a Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 09:47:52 -0700 Subject: [PATCH 19/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index acd17f732b..103bfc6730 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -136,7 +136,10 @@ builder.Services.AddValidation(); // This attribute is needed on the top-level model type. // The other types are discovered automatically. +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. [ValidatableType] +#pragma warning restore ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + public class OrderModel { public CustomerModel CustomerDetails { get; set; } = new CustomerModel(); From 15464c8592cb238f38689a72dbff6a4a4bdc9f97 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 09:54:33 -0700 Subject: [PATCH 20/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 103bfc6730..de35304827 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -184,7 +184,7 @@ The requirement to declare model types outside of `.razor` files is due to the f ## NotFound works with streaming that has started -Blazor now supports calling `NotFound()` even when streaming has already started. This improvement allows for better error handling in scenarios where content has already begun streaming to the client but a not-found condition is later encountered. +Calling `NavigationManager.NotFound()` now works even when streaming a response has already started. This improvement allows for better error handling in scenarios where content has already begun streaming to the client, but a not found condition is later encountered. ## Blazor diagnostics improvements From 00f298188be7fb3f7eb19c905d072ac28dabcb7c Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 09:54:50 -0700 Subject: [PATCH 21/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index de35304827..5c90e81705 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -182,7 +182,7 @@ public class CustomerModel The requirement to declare model types outside of `.razor` files is due to the fact that both the validation feature and the Razor compiler use source generators. Currently, output of one source generator cannot be used as input for another source generator. -## NotFound works with streaming that has started +## `NavigationManager.NotFound()` works after streaming has started Calling `NavigationManager.NotFound()` now works even when streaming a response has already started. This improvement allows for better error handling in scenarios where content has already begun streaming to the client, but a not found condition is later encountered. From c7ea121ab616f339487e584713a82e9a0c708d1d Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 09:55:45 -0700 Subject: [PATCH 22/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 5c90e81705..4eedba8001 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -6,7 +6,7 @@ Here's a summary of what's new in ASP.NET Core in this preview release: - [Blazor WebAssembly preloading](#blazor-webassembly-preloading) - [Blazor build producing javascript bundler friendly output](#blazor-build-producing-javascript-bundler-friendly-output) - [Improved form validation for Blazor](#improved-form-validation-for-blazor) -- [NotFound works with streaming that has started](#notfound-works-with-streaming-that-has-started) +- [`NavigationManager.NotFound()` works after streaming has started](#notfound-works-with-streaming-that-has-started) - [Blazor diagnostics improvements](#blazor-diagnostics-improvements) - [NavigationException switch behavior change](#navigationexception-switch-behavior-change) - [Add passkey support to ASP.NET Core Identity](#add-passkey-support-to-aspnet-core-identity) From 99f6bda46ad9190f15cae6798deb40bfabb38bb1 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 09:56:28 -0700 Subject: [PATCH 23/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 4eedba8001..be9edbbf4c 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -6,7 +6,7 @@ Here's a summary of what's new in ASP.NET Core in this preview release: - [Blazor WebAssembly preloading](#blazor-webassembly-preloading) - [Blazor build producing javascript bundler friendly output](#blazor-build-producing-javascript-bundler-friendly-output) - [Improved form validation for Blazor](#improved-form-validation-for-blazor) -- [`NavigationManager.NotFound()` works after streaming has started](#notfound-works-with-streaming-that-has-started) +- [`NavigationManager.NotFound()` works after streaming has started](#navigationmanagernotfound-works-after-streaming-has-started) - [Blazor diagnostics improvements](#blazor-diagnostics-improvements) - [NavigationException switch behavior change](#navigationexception-switch-behavior-change) - [Add passkey support to ASP.NET Core Identity](#add-passkey-support-to-aspnet-core-identity) From b185f5171c2fb458caa2d05f6b64ee8216bab1b6 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 09:59:57 -0700 Subject: [PATCH 24/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index be9edbbf4c..31a84360bd 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -188,9 +188,11 @@ Calling `NavigationManager.NotFound()` now works even when streaming a response ## Blazor diagnostics improvements -All Blazor traces are now top level in the Aspire dashboard and in Application Insights, instead of being nested under HTTP or SignalR parent traces. Additionally, the `CircuitStart` trace has been moved to a separate `Microsoft.AspNetCore.Components.Server.Circuits` source. +All Blazor Server traces are now top-level activities, instead of being nested under HTTP or SignalR parent activities. This simplifies looking at Blazor Server traces in diagnostic tools like the .NET Aspire developer dashboard or in Application Insights. -To configure OpenTelemetry for the new trace sources: +Additionally, the `CircuitStart` trace has been moved to a separate `Microsoft.AspNetCore.Components.Server.Circuits` source. + +To configure the new trace source: ```diff builder.Services.ConfigureOpenTelemetryTracerProvider(tracerProvider => From 5cc2d44b068e24c882ff07b931fad981fbe4677f Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 10:06:44 -0700 Subject: [PATCH 25/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 31a84360bd..ca0456c9ac 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -202,16 +202,16 @@ builder.Services.ConfigureOpenTelemetryTracerProvider(tracerProvider => }); ``` -## NavigationException switch behavior change +## Disabling `NavigationException` usage is now opt-in -The default behavior for `NavigationException` has changed. The configuration switch has been renamed and its default value updated: +To improve backwards compatibility, disabling usage of `NavigationException` for Blazor page navigations is now opt-in. The configuration switch has been renamed and its default value updated: ```diff - "Microsoft.AspNetCore.Components.Endpoints.NavigationManager.EnableThrowNavigationException", default value: false + "Microsoft.AspNetCore.Components.Endpoints.NavigationManager.DisableThrowNavigationException", default value: true ``` -This change improves the default navigation behavior in Blazor applications. +The Blazor Web App template has been updated to disable the use of `NavigationException` so that navigation behavior across render modes is more consistent for new Blazor apps. ## Add passkey support to ASP.NET Core Identity From c6dac18d77e120f96c1a1557058170c6787075d0 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 10:09:03 -0700 Subject: [PATCH 26/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index ca0456c9ac..5ae5e4ec1b 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -215,7 +215,7 @@ The Blazor Web App template has been updated to disable the use of `NavigationEx ## Add passkey support to ASP.NET Core Identity -Passkeys are a modern, phishing-resistant authentication method that improves security and user experience by leveraging public key cryptography and device-based authentication. ASP.NET Core Identity now supports passkey authentication based on WebAuthn and FIDO2 standards. This feature allows users to sign in without passwords, using secure, device-based authentication methods like biometrics or security keys. +Passkeys are a modern, phishing-resistant authentication method that improves security and user experience by leveraging public key cryptography and device-based authentication. ASP.NET Core Identity now supports passkey authentication based on the WebAuthn and FIDO2 standards. This feature allows users to sign in without passwords, using secure, device-based authentication methods like biometrics or security keys. The Blazor Web App template provides out-of-the-box passkey management and login functionality. From a14ffe8ef2408b56cf7a79de38fe4b2bcdd29a5a Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 10:09:33 -0700 Subject: [PATCH 27/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 5ae5e4ec1b..0f1270820f 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -221,7 +221,7 @@ The Blazor Web App template provides out-of-the-box passkey management and login Developers can use new APIs to enable and manage passkey authentication in existing apps. -## Minimal API Validation integration with IProblemDetailsService +## Minimal API validation integration with IProblemDetailsService Error responses from the validation logic for minimal APIs can now be customized by an `IProblemDetailsService` implementation provided in the application services collection (DI container). This enables more consistent and user-specific error responses in an ASP.NET Core application. From d1470f5cb1ed27130b73b21d305bc0173f24aff3 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 10:10:34 -0700 Subject: [PATCH 28/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 0f1270820f..9a63b78989 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -8,7 +8,7 @@ Here's a summary of what's new in ASP.NET Core in this preview release: - [Improved form validation for Blazor](#improved-form-validation-for-blazor) - [`NavigationManager.NotFound()` works after streaming has started](#navigationmanagernotfound-works-after-streaming-has-started) - [Blazor diagnostics improvements](#blazor-diagnostics-improvements) -- [NavigationException switch behavior change](#navigationexception-switch-behavior-change) +- [Disabling `NavigationException` usage is now opt-in](#disabling-navigationexception-usage-is-now-opt-in) - [Add passkey support to ASP.NET Core Identity](#add-passkey-support-to-aspnet-core-identity) - [Minimal API Validation integration with IProblemDetailsService](#minimal-api-validation-integration-with-iproblemdetailsservice) - [Unified validation APIs moved to extensions package](#unified-validation-apis-moved-to-extensions-package) From d546ce2ae21c3252f123fa13cd85fde84309402d Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 10:10:55 -0700 Subject: [PATCH 29/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 9a63b78989..f110ec36d6 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -10,7 +10,7 @@ Here's a summary of what's new in ASP.NET Core in this preview release: - [Blazor diagnostics improvements](#blazor-diagnostics-improvements) - [Disabling `NavigationException` usage is now opt-in](#disabling-navigationexception-usage-is-now-opt-in) - [Add passkey support to ASP.NET Core Identity](#add-passkey-support-to-aspnet-core-identity) -- [Minimal API Validation integration with IProblemDetailsService](#minimal-api-validation-integration-with-iproblemdetailsservice) +- [Minimal API validation integration with IProblemDetailsService](#minimal-api-validation-integration-with-iproblemdetailsservice) - [Unified validation APIs moved to extensions package](#unified-validation-apis-moved-to-extensions-package) ASP.NET Core updates in .NET 10: From 9d13236947b2d2e70e04ea472a318ed77c9e29f8 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 10:11:26 -0700 Subject: [PATCH 30/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index f110ec36d6..429ce2a36b 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -221,7 +221,7 @@ The Blazor Web App template provides out-of-the-box passkey management and login Developers can use new APIs to enable and manage passkey authentication in existing apps. -## Minimal API validation integration with IProblemDetailsService +## Minimal API validation integration with `IProblemDetailsService` Error responses from the validation logic for minimal APIs can now be customized by an `IProblemDetailsService` implementation provided in the application services collection (DI container). This enables more consistent and user-specific error responses in an ASP.NET Core application. From 34a042e31815c2089e20935e087d62f5d752ce5e Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 10:11:48 -0700 Subject: [PATCH 31/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 429ce2a36b..589ba4abdf 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -10,7 +10,7 @@ Here's a summary of what's new in ASP.NET Core in this preview release: - [Blazor diagnostics improvements](#blazor-diagnostics-improvements) - [Disabling `NavigationException` usage is now opt-in](#disabling-navigationexception-usage-is-now-opt-in) - [Add passkey support to ASP.NET Core Identity](#add-passkey-support-to-aspnet-core-identity) -- [Minimal API validation integration with IProblemDetailsService](#minimal-api-validation-integration-with-iproblemdetailsservice) +- [Minimal API validation integration with `IProblemDetailsService`](#minimal-api-validation-integration-with-iproblemdetailsservice) - [Unified validation APIs moved to extensions package](#unified-validation-apis-moved-to-extensions-package) ASP.NET Core updates in .NET 10: From f479438bd0b227b63e2e412c7570ea29118217e3 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 10:14:38 -0700 Subject: [PATCH 32/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 589ba4abdf..4547b0c067 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -229,7 +229,7 @@ Community contribution from [@marcominerva](https://github.com/marcominerva). Th ## Unified validation APIs moved to extensions package -The validation APIs have been moved to the `Microsoft.Extensions.Validation` namespace/NuGet package, making them usable outside of ASP.NET Core HTTP scenarios. The public APIs and their behavior remain the same, just under a new package and namespace. Existing projects should not require code changes; old references will redirect to the new implementation. +The validation APIs have been moved to the `Microsoft.Extensions.Validation` namespace and NuGet package, making them usable outside of ASP.NET Core scenarios. The public APIs and their behavior remain the same, just under a new package and namespace. Existing projects should not require code changes; old references will redirect to the new implementation. The APIs have also been marked as experimental as they are subject to future changes. ## Contributors From d0068c413fac397bd0deda6c666e42d21cb39854 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 4 Jul 2025 17:26:06 +0000 Subject: [PATCH 33/45] Remove "Unified" from validation APIs section title per feedback Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- release-notes/10.0/preview/preview6/aspnetcore.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 4547b0c067..ec867c5909 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -11,7 +11,7 @@ Here's a summary of what's new in ASP.NET Core in this preview release: - [Disabling `NavigationException` usage is now opt-in](#disabling-navigationexception-usage-is-now-opt-in) - [Add passkey support to ASP.NET Core Identity](#add-passkey-support-to-aspnet-core-identity) - [Minimal API validation integration with `IProblemDetailsService`](#minimal-api-validation-integration-with-iproblemdetailsservice) -- [Unified validation APIs moved to extensions package](#unified-validation-apis-moved-to-extensions-package) +- [Validation APIs moved to extensions package](#validation-apis-moved-to-extensions-package) ASP.NET Core updates in .NET 10: @@ -227,7 +227,7 @@ Error responses from the validation logic for minimal APIs can now be customized Community contribution from [@marcominerva](https://github.com/marcominerva). Thank you! -## Unified validation APIs moved to extensions package +## Validation APIs moved to extensions package The validation APIs have been moved to the `Microsoft.Extensions.Validation` namespace and NuGet package, making them usable outside of ASP.NET Core scenarios. The public APIs and their behavior remain the same, just under a new package and namespace. Existing projects should not require code changes; old references will redirect to the new implementation. The APIs have also been marked as experimental as they are subject to future changes. From 61d0cd212e444a49006abb581b9c8244ee3d03dd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 4 Jul 2025 17:29:20 +0000 Subject: [PATCH 34/45] Update contributors list to only include non-Microsoft contributors Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- release-notes/10.0/preview/preview6/aspnetcore.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index ec867c5909..59335cffe1 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -236,11 +236,7 @@ The validation APIs have been moved to the `Microsoft.Extensions.Validation` nam Thank you contributors! ❤️ - [@am11](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Aam11) -- [@BrennanConroy](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3ABrennanConroy) -- [@guardrex](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Aguardrex) -- [@ilonatommy](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Ailonatommy) - [@maraf](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amaraf) - [@marcominerva](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amarcominerva) - [@mikekistler](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amikekistler) - [@oroztocil](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Aoroztocil) -- [@pavelsavara](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Apavelsavara) From 6d84ab0d559c061d33c6e3045a1bf4034f5caa05 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 10:32:28 -0700 Subject: [PATCH 35/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 59335cffe1..34a8324713 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -235,8 +235,11 @@ The validation APIs have been moved to the `Microsoft.Extensions.Validation` nam Thank you contributors! ❤️ -- [@am11](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Aam11) -- [@maraf](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amaraf) -- [@marcominerva](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amarcominerva) -- [@mikekistler](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amikekistler) -- [@oroztocil](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Aoroztocil) +- [martincostello](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amartincostello) +- [jzabroski](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Ajzabroski) +- [BrendanRidenour](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3ABrendanRidenour) +- [v-wuzhai](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Av-wuzhai) +- [marcominerva](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amarcominerva) +- [timdeschryver](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Atimdeschryver) +- [tmds](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Atmds) +- [saitama951](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Asaitama951) From 97c975de4c7a9111f1c4d625615b82c28e6b07f8 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 10:33:33 -0700 Subject: [PATCH 36/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 34a8324713..c1f8e3afde 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -235,11 +235,11 @@ The validation APIs have been moved to the `Microsoft.Extensions.Validation` nam Thank you contributors! ❤️ -- [martincostello](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amartincostello) -- [jzabroski](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Ajzabroski) - [BrendanRidenour](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3ABrendanRidenour) -- [v-wuzhai](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Av-wuzhai) +- [jzabroski](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Ajzabroski) - [marcominerva](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amarcominerva) +- [martincostello](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Amartincostello) +- [saitama951](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Asaitama951) - [timdeschryver](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Atimdeschryver) - [tmds](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Atmds) -- [saitama951](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Asaitama951) +- [v-wuzhai](https://github.com/dotnet/aspnetcore/pulls?q=is%3Apr+is%3Amerged+milestone%3A10.0-preview6+author%3Av-wuzhai) From 5e883177decda792bf2e00693eb817133cf0c5fd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 4 Jul 2025 17:52:44 +0000 Subject: [PATCH 37/45] Add Blazor Server state persistence section to ASP.NET Core 10 Preview 6 release notes Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- .../10.0/preview/preview6/aspnetcore.md | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index c1f8e3afde..998a2ec0ad 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -8,6 +8,7 @@ Here's a summary of what's new in ASP.NET Core in this preview release: - [Improved form validation for Blazor](#improved-form-validation-for-blazor) - [`NavigationManager.NotFound()` works after streaming has started](#navigationmanagernotfound-works-after-streaming-has-started) - [Blazor diagnostics improvements](#blazor-diagnostics-improvements) +- [Blazor Server state persistence](#blazor-server-state-persistence) - [Disabling `NavigationException` usage is now opt-in](#disabling-navigationexception-usage-is-now-opt-in) - [Add passkey support to ASP.NET Core Identity](#add-passkey-support-to-aspnet-core-identity) - [Minimal API validation integration with `IProblemDetailsService`](#minimal-api-validation-integration-with-iproblemdetailsservice) @@ -202,6 +203,46 @@ builder.Services.ConfigureOpenTelemetryTracerProvider(tracerProvider => }); ``` +## Blazor Server state persistence + +Blazor Server apps now automatically persist the state of circuits before evicting them from memory. When a client reconnects after a prolonged period, the app can restore the circuit state, allowing users to resume their work uninterrupted. + +**Why it matters:** +Previously, when a circuit was evicted due to memory pressure or other factors, all client state would be lost. Users would have to start over, losing their progress and creating a poor user experience. With automatic state persistence, applications can now maintain continuity even when circuits need to be temporarily removed from memory. + +**How it works:** +Circuit state is persisted either in memory or using `HybridCache` if configured for the app. The framework handles this automatically, requiring no changes to existing code. + +You can also implement custom policies for persisting and evicting circuits using the new `Blazor.pause()` and `Blazor.resume()` JavaScript APIs. These APIs allow you to control when circuits are paused and resumed based on your application's specific needs. + +```javascript +// Pause the circuit when the tab becomes hidden +document.addEventListener('visibilitychange', () => { + if (document.hidden) { + Blazor.pause(); + } else { + Blazor.resume(); + } +}); + +// Pause the circuit during server maintenance +function pauseForMaintenance() { + Blazor.pause(); + // Perform maintenance tasks +} + +// Resume the circuit after maintenance +function resumeAfterMaintenance() { + Blazor.resume(); +} +``` + +Custom policies might be useful when: +- The circuit is idle and hasn't been used for a while +- The server is restarting or undergoing maintenance +- The client browser tab isn't currently visible to the user +- You want to optimize memory usage during low-activity periods + ## Disabling `NavigationException` usage is now opt-in To improve backwards compatibility, disabling usage of `NavigationException` for Blazor page navigations is now opt-in. The configuration switch has been renamed and its default value updated: From 20e2dd4117a3fa2469d19217e48849953e662530 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 11:05:19 -0700 Subject: [PATCH 38/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- .../10.0/preview/preview6/aspnetcore.md | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 998a2ec0ad..36ff026101 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -213,7 +213,9 @@ Previously, when a circuit was evicted due to memory pressure or other factors, **How it works:** Circuit state is persisted either in memory or using `HybridCache` if configured for the app. The framework handles this automatically, requiring no changes to existing code. -You can also implement custom policies for persisting and evicting circuits using the new `Blazor.pause()` and `Blazor.resume()` JavaScript APIs. These APIs allow you to control when circuits are paused and resumed based on your application's specific needs. +You can also implement custom policies for persisting and evicting circuits using the new `Blazor.pause()` and `Blazor.resume()` JavaScript APIs. These APIs allow you to control when circuits are paused and resumed based on your application's specific needs. For example, you might choose to pause circuit when the circuit is idle, when the server is about to restart, or when the browser tab isn't currently visible to the user. When the circuit is paused, it is persisted to the client to free up server resources. + +The following example shows how you might pause the app when it isn't currently visible and then resume it when it becomes visible again to save on server resources: ```javascript // Pause the circuit when the tab becomes hidden @@ -224,25 +226,8 @@ document.addEventListener('visibilitychange', () => { Blazor.resume(); } }); - -// Pause the circuit during server maintenance -function pauseForMaintenance() { - Blazor.pause(); - // Perform maintenance tasks -} - -// Resume the circuit after maintenance -function resumeAfterMaintenance() { - Blazor.resume(); -} ``` -Custom policies might be useful when: -- The circuit is idle and hasn't been used for a while -- The server is restarting or undergoing maintenance -- The client browser tab isn't currently visible to the user -- You want to optimize memory usage during low-activity periods - ## Disabling `NavigationException` usage is now opt-in To improve backwards compatibility, disabling usage of `NavigationException` for Blazor page navigations is now opt-in. The configuration switch has been renamed and its default value updated: From 9ace9913ffff282b24b60936d4fe0b86c024eacd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 4 Jul 2025 18:19:10 +0000 Subject: [PATCH 39/45] Clarify that only declared state is persisted and remove 'automatic' language Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- release-notes/10.0/preview/preview6/aspnetcore.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 36ff026101..dab0c7b745 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -205,13 +205,13 @@ builder.Services.ConfigureOpenTelemetryTracerProvider(tracerProvider => ## Blazor Server state persistence -Blazor Server apps now automatically persist the state of circuits before evicting them from memory. When a client reconnects after a prolonged period, the app can restore the circuit state, allowing users to resume their work uninterrupted. +Blazor Server apps now persist the declared state of circuits before evicting them from memory. When a client reconnects after a prolonged period, the app can restore the circuit state, allowing users to resume their work uninterrupted. **Why it matters:** -Previously, when a circuit was evicted due to memory pressure or other factors, all client state would be lost. Users would have to start over, losing their progress and creating a poor user experience. With automatic state persistence, applications can now maintain continuity even when circuits need to be temporarily removed from memory. +Previously, when a circuit was evicted due to memory pressure or other factors, all client state would be lost. Users would have to start over, losing their progress and creating a poor user experience. With state persistence, applications can now maintain continuity even when circuits need to be temporarily removed from memory. **How it works:** -Circuit state is persisted either in memory or using `HybridCache` if configured for the app. The framework handles this automatically, requiring no changes to existing code. +Circuit state is persisted either in memory or using `HybridCache` if configured for the app. Only declared state is persisted, and the framework handles the persistence without requiring changes to existing code. You can also implement custom policies for persisting and evicting circuits using the new `Blazor.pause()` and `Blazor.resume()` JavaScript APIs. These APIs allow you to control when circuits are paused and resumed based on your application's specific needs. For example, you might choose to pause circuit when the circuit is idle, when the server is about to restart, or when the browser tab isn't currently visible to the user. When the circuit is paused, it is persisted to the client to free up server resources. From ec78cb725d1f777290818fbc6aa1c192198e6b6d Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 11:21:24 -0700 Subject: [PATCH 40/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index dab0c7b745..f257842b7f 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -211,7 +211,7 @@ Blazor Server apps now persist the declared state of circuits before evicting th Previously, when a circuit was evicted due to memory pressure or other factors, all client state would be lost. Users would have to start over, losing their progress and creating a poor user experience. With state persistence, applications can now maintain continuity even when circuits need to be temporarily removed from memory. **How it works:** -Circuit state is persisted either in memory or using `HybridCache` if configured for the app. Only declared state is persisted, and the framework handles the persistence without requiring changes to existing code. +Circuit state is persisted either in memory or using `HybridCache` if configured for the app. Only declared state is persisted. You can also implement custom policies for persisting and evicting circuits using the new `Blazor.pause()` and `Blazor.resume()` JavaScript APIs. These APIs allow you to control when circuits are paused and resumed based on your application's specific needs. For example, you might choose to pause circuit when the circuit is idle, when the server is about to restart, or when the browser tab isn't currently visible to the user. When the circuit is paused, it is persisted to the client to free up server resources. From 687a2332b6383b74248f4145483827211b30b33f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 4 Jul 2025 18:28:37 +0000 Subject: [PATCH 41/45] Edit content for clarity and simplicity throughout release notes Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- .../10.0/preview/preview6/aspnetcore.md | 100 ++++++++---------- 1 file changed, 44 insertions(+), 56 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index f257842b7f..76db78b0da 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -22,17 +22,17 @@ ASP.NET Core updates in .NET 10: ## Automatic eviction from memory pool -The memory pools used by Kestrel, IIS, and HTTP.sys now automatically evict memory blocks when the application is idle or under less load, helping applications use resources more efficiently. +Memory pools used by Kestrel, IIS, and HTTP.sys now release unused memory when applications are idle, improving resource efficiency. **Why it matters:** -Previously, memory allocated by the pool would remain reserved, even when not in use. With this enhancement, when the app is idle for a period of time, memory is now released back to the system, reducing overall memory usage and helping applications stay responsive under varying workloads. +Previously, pooled memory stayed reserved even when unused. Now memory is automatically returned to the system during idle periods, reducing overall memory usage. **How to use:** -No action is needed to benefit from this feature. Memory eviction is handled automatically by the framework. +No action needed. This works automatically. -There are also metrics added to the default memory pool used by our server implementations. The new metrics are under the name `Microsoft.AspNetCore.MemoryPool`. See the [ASP.NET Core metrics documentation](https://learn.microsoft.com/aspnet/core/log-mon/metrics/metrics) for general information on what metrics are and how to use them. +There are also metrics available for the memory pool under the name `Microsoft.AspNetCore.MemoryPool`. See the [ASP.NET Core metrics documentation](https://learn.microsoft.com/aspnet/core/log-mon/metrics/metrics) for more information. -You can also use the new `IMemoryPoolFactory` service interface to create or access memory pools for custom scenarios: +You can create custom memory pools using the new `IMemoryPoolFactory` service interface: ```csharp public class MyBackgroundService : BackgroundService @@ -48,23 +48,17 @@ public class MyBackgroundService : BackgroundService { while (!stoppingToken.IsCancellationRequested) { - try - { - await Task.Delay(20, stoppingToken); - // do work that needs memory - var rented = _memoryPool.Rent(100); - rented.Dispose(); - } - catch (OperationCanceledException) - { - return; - } + // Use memory from the pool + var rented = _memoryPool.Rent(100); + // ... do work ... + rented.Dispose(); + await Task.Delay(20, stoppingToken); } } } ``` -Use a custom `IMemoryPoolFactory` to replace the memory pool being used: +To replace the default memory pool with a custom implementation: ```csharp services.AddSingleton, CustomMemoryPoolFactory>(); @@ -73,17 +67,16 @@ public class CustomMemoryPoolFactory : IMemoryPoolFactory { public MemoryPool Create() { - // Return a custom MemoryPool implementation or the default. - return MemoryPool.Shared; + return MemoryPool.Shared; // or custom implementation } } ``` ## Blazor WebAssembly preloading -Blazor now provides a `` component to generate `link` tags instead of using link headers to preload framework assets. This allows the framework to correctly identify the Blazor application base URL and provides better control over the preloading behavior. +Blazor now provides a `` component that generates `link` tags for preloading framework assets instead of using link headers. This gives better control over preloading behavior and correctly identifies the application's base URL. -To use this feature, place the `` component in the head of your application: +To enable preloading, add the `` component to your application's head: ```diff @@ -93,11 +86,11 @@ To use this feature, place the `` component in the head of your a ``` -Removing the component will disable the preloading feature, which is useful in cases where the application uses the `loadBootResource` callback to modify URLs. +Remove the component to disable preloading, which is useful when using the `loadBootResource` callback to modify URLs. ## Blazor build producing javascript bundler friendly output -Set the new `WasmBundlerFriendlyBootConfig` MSBuild property to `true` to make the Blazor WebAssembly build output compatible with tools like webpack or rollup. +Make Blazor WebAssembly compatible with JavaScript bundlers like webpack or rollup by setting the `WasmBundlerFriendlyBootConfig` property to `true`. ```xml @@ -105,38 +98,34 @@ Set the new `WasmBundlerFriendlyBootConfig` MSBuild property to `true` to make t ``` -Setting this property will adjust the .NET boot configuration to explicitly import framework assets. The output won't be directly runnable in the browser, but the project's published out can be consumed by JavaScript bundlers to combine it with other scripts. +This adjusts the boot configuration to explicitly import framework assets. The output won't run directly in browsers but can be consumed by JavaScript bundlers. ## Improved form validation for Blazor -Blazor now has improved form validation capabilities including support for validating properties of nested objects and collection items. +Blazor now supports validating nested objects and collection items in forms. -To create a validated form, use a `DataAnnotationsValidator` component inside an `EditForm` component, just as before. To opt into the new validation feature, do the following: +To use this feature: -1. Call the `AddValidation` extension method in your application setup. -2. Declare the form model types in a .cs file (i.e., not a .razor file). -3. Annotate the root form model type with the `[ValidatableType]` attribute. +1. Call `AddValidation()` in your application setup +2. Create model types in .cs files (not .razor files) +3. Add the `[ValidatableType]` attribute to your root model type -Without these steps, the validation behavior remains the same as in previous versions where only the top-level type is validated. +Without these steps, validation works the same as before (top-level only). -Note that the `[ValidatableType]` attribute is currently experimental and is subject to change, so using this attribute will result in a build error. You'll need to suppress this diagnostic to try out the feature. +**Note:** The `[ValidatableType]` attribute is experimental and causes a build error. Suppress the diagnostic to use this feature. -Here's an example: +Example: ```csharp // Program.cs var builder = WebApplication.CreateBuilder(args); builder.Services.AddRazorComponents(); - -// This line enables the new validation behavior. -builder.Services.AddValidation(); +builder.Services.AddValidation(); // Enable new validation behavior ``` ```csharp // Data/OrderModel.cs -// This attribute is needed on the top-level model type. -// The other types are discovered automatically. #pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. [ValidatableType] #pragma warning restore ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. @@ -172,8 +161,7 @@ public class CustomerModel - - @* ... *@ + @code { @@ -181,17 +169,17 @@ public class CustomerModel } ``` -The requirement to declare model types outside of `.razor` files is due to the fact that both the validation feature and the Razor compiler use source generators. Currently, output of one source generator cannot be used as input for another source generator. +Model types must be in .cs files because validation uses source generators, and one source generator's output can't be input for another. ## `NavigationManager.NotFound()` works after streaming has started -Calling `NavigationManager.NotFound()` now works even when streaming a response has already started. This improvement allows for better error handling in scenarios where content has already begun streaming to the client, but a not found condition is later encountered. +`NavigationManager.NotFound()` now works even after response streaming begins, enabling better error handling when content has already started streaming but a not found condition occurs later. ## Blazor diagnostics improvements -All Blazor Server traces are now top-level activities, instead of being nested under HTTP or SignalR parent activities. This simplifies looking at Blazor Server traces in diagnostic tools like the .NET Aspire developer dashboard or in Application Insights. +Blazor Server traces are now top-level activities instead of being nested under HTTP or SignalR activities. This simplifies viewing traces in diagnostic tools like the .NET Aspire dashboard or Application Insights. -Additionally, the `CircuitStart` trace has been moved to a separate `Microsoft.AspNetCore.Components.Server.Circuits` source. +The `CircuitStart` trace moved to a separate `Microsoft.AspNetCore.Components.Server.Circuits` source. To configure the new trace source: @@ -205,20 +193,20 @@ builder.Services.ConfigureOpenTelemetryTracerProvider(tracerProvider => ## Blazor Server state persistence -Blazor Server apps now persist the declared state of circuits before evicting them from memory. When a client reconnects after a prolonged period, the app can restore the circuit state, allowing users to resume their work uninterrupted. +Blazor Server apps now persist declared circuit state before evicting circuits from memory. When clients reconnect after extended periods, apps can restore circuit state, letting users resume their work uninterrupted. **Why it matters:** -Previously, when a circuit was evicted due to memory pressure or other factors, all client state would be lost. Users would have to start over, losing their progress and creating a poor user experience. With state persistence, applications can now maintain continuity even when circuits need to be temporarily removed from memory. +Previously, circuit eviction meant losing all client state. Users had to restart, losing progress and creating poor experiences. State persistence maintains continuity even when circuits are temporarily removed from memory. **How it works:** -Circuit state is persisted either in memory or using `HybridCache` if configured for the app. Only declared state is persisted. +Circuit state persists in memory or using `HybridCache` if configured. Only declared state is persisted. -You can also implement custom policies for persisting and evicting circuits using the new `Blazor.pause()` and `Blazor.resume()` JavaScript APIs. These APIs allow you to control when circuits are paused and resumed based on your application's specific needs. For example, you might choose to pause circuit when the circuit is idle, when the server is about to restart, or when the browser tab isn't currently visible to the user. When the circuit is paused, it is persisted to the client to free up server resources. +You can implement custom policies using the new `Blazor.pause()` and `Blazor.resume()` JavaScript APIs. These control when circuits pause and resume based on your needs. For example, pause when idle, during server restarts, or when browser tabs aren't visible. Paused circuits persist to the client, freeing server resources. -The following example shows how you might pause the app when it isn't currently visible and then resume it when it becomes visible again to save on server resources: +Example - pause the app when hidden and resume when visible to save server resources: ```javascript -// Pause the circuit when the tab becomes hidden +// Pause when tab becomes hidden, resume when visible document.addEventListener('visibilitychange', () => { if (document.hidden) { Blazor.pause(); @@ -230,32 +218,32 @@ document.addEventListener('visibilitychange', () => { ## Disabling `NavigationException` usage is now opt-in -To improve backwards compatibility, disabling usage of `NavigationException` for Blazor page navigations is now opt-in. The configuration switch has been renamed and its default value updated: +To improve backwards compatibility, disabling `NavigationException` for Blazor page navigations is now opt-in. The configuration switch was renamed with an updated default value: ```diff - "Microsoft.AspNetCore.Components.Endpoints.NavigationManager.EnableThrowNavigationException", default value: false + "Microsoft.AspNetCore.Components.Endpoints.NavigationManager.DisableThrowNavigationException", default value: true ``` -The Blazor Web App template has been updated to disable the use of `NavigationException` so that navigation behavior across render modes is more consistent for new Blazor apps. +The Blazor Web App template disables `NavigationException` usage for more consistent navigation behavior across render modes. ## Add passkey support to ASP.NET Core Identity -Passkeys are a modern, phishing-resistant authentication method that improves security and user experience by leveraging public key cryptography and device-based authentication. ASP.NET Core Identity now supports passkey authentication based on the WebAuthn and FIDO2 standards. This feature allows users to sign in without passwords, using secure, device-based authentication methods like biometrics or security keys. +ASP.NET Core Identity now supports passkey authentication based on WebAuthn and FIDO2 standards. Passkeys provide a modern, phishing-resistant authentication method using public key cryptography and device-based authentication, allowing users to sign in without passwords using biometrics or security keys. -The Blazor Web App template provides out-of-the-box passkey management and login functionality. +The Blazor Web App template includes built-in passkey management and login functionality. -Developers can use new APIs to enable and manage passkey authentication in existing apps. +Developers can use new APIs to add passkey authentication to existing applications. ## Minimal API validation integration with `IProblemDetailsService` -Error responses from the validation logic for minimal APIs can now be customized by an `IProblemDetailsService` implementation provided in the application services collection (DI container). This enables more consistent and user-specific error responses in an ASP.NET Core application. +Minimal API validation error responses can now be customized using an `IProblemDetailsService` implementation in the services collection (DI container). This enables more consistent and user-specific error responses. Community contribution from [@marcominerva](https://github.com/marcominerva). Thank you! ## Validation APIs moved to extensions package -The validation APIs have been moved to the `Microsoft.Extensions.Validation` namespace and NuGet package, making them usable outside of ASP.NET Core scenarios. The public APIs and their behavior remain the same, just under a new package and namespace. Existing projects should not require code changes; old references will redirect to the new implementation. The APIs have also been marked as experimental as they are subject to future changes. +The validation APIs moved to the `Microsoft.Extensions.Validation` namespace and NuGet package, making them usable outside ASP.NET Core scenarios. The public APIs and behavior remain the same, just under a new package and namespace. Existing projects should work without code changes as old references redirect to the new implementation. The APIs are marked as experimental and subject to future changes. ## Contributors From ae5a380a97f922d18843b509ac6d07ec7a10574f Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 4 Jul 2025 15:39:21 -0700 Subject: [PATCH 42/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 76db78b0da..b1b6aa3c66 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -98,7 +98,7 @@ Make Blazor WebAssembly compatible with JavaScript bundlers like webpack or roll ``` -This adjusts the boot configuration to explicitly import framework assets. The output won't run directly in browsers but can be consumed by JavaScript bundlers. +This adjusts the boot configuration to explicitly import framework assets. The build output won't run directly in browsers but the publish output can be consumed by JavaScript bundlers. ## Improved form validation for Blazor From 34bd214cb15c40586af0639bffd851cf7664fed4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 4 Jul 2025 22:40:05 +0000 Subject: [PATCH 43/45] Add back try/catch logic to memory pool code example Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- .../10.0/preview/preview6/aspnetcore.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index b1b6aa3c66..12b6817e59 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -48,11 +48,17 @@ public class MyBackgroundService : BackgroundService { while (!stoppingToken.IsCancellationRequested) { - // Use memory from the pool - var rented = _memoryPool.Rent(100); - // ... do work ... - rented.Dispose(); - await Task.Delay(20, stoppingToken); + try + { + await Task.Delay(20, stoppingToken); + // do work that needs memory + var rented = _memoryPool.Rent(100); + rented.Dispose(); + } + catch (OperationCanceledException) + { + return; + } } } } From 987c6ea2199eb8d81d64f45d31bcda22c76363ac Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 9 Jul 2025 08:58:24 -0700 Subject: [PATCH 44/45] Update release-notes/10.0/preview/preview6/aspnetcore.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marek Fišera --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 12b6817e59..141d6775c8 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -104,7 +104,7 @@ Make Blazor WebAssembly compatible with JavaScript bundlers like webpack or roll ``` -This adjusts the boot configuration to explicitly import framework assets. The build output won't run directly in browsers but the publish output can be consumed by JavaScript bundlers. +This adjusts the boot configuration to use import statements for framework assets that JavaScript bundlers will understand and correctly identify related files. The build output won't be directly runnable in the browser and post processing by JavaScript tools is expected. ## Improved form validation for Blazor From 8d55b343dae6a0a3097fa210adadb42c403d1cdf Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 9 Jul 2025 09:15:17 -0700 Subject: [PATCH 45/45] Update release-notes/10.0/preview/preview6/aspnetcore.md --- release-notes/10.0/preview/preview6/aspnetcore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/10.0/preview/preview6/aspnetcore.md b/release-notes/10.0/preview/preview6/aspnetcore.md index 141d6775c8..c055158d48 100644 --- a/release-notes/10.0/preview/preview6/aspnetcore.md +++ b/release-notes/10.0/preview/preview6/aspnetcore.md @@ -104,7 +104,7 @@ Make Blazor WebAssembly compatible with JavaScript bundlers like webpack or roll ``` -This adjusts the boot configuration to use import statements for framework assets that JavaScript bundlers will understand and correctly identify related files. The build output won't be directly runnable in the browser and post processing by JavaScript tools is expected. +This adjusts the boot configuration to use import statements for framework assets that JavaScript bundlers can then use to correctly identify related files. The build output won't be directly runnable in the browser; post processing by JavaScript tools is expected. ## Improved form validation for Blazor