As of the latest .NET 11 Preview releases (March 2026), ASP.NET Core and Blazor have introduced several features focused on developer productivity, cleaner code, and better performance.
Summary of the most significant changes:
Blazor Improvements
New Components
DisplayName Component: A new built-in component that renders property names directly from metadata attributes like [Display] or [DisplayName]. This brings feature parity with MVC’s @Html.DisplayNameFor().
Label Component: Specifically for forms, this component renders accessible <label> elements and automatically extracts the display name from your model attributes.
EnvironmentBoundary: Allows you to conditionally render content based on the hosting environment (e.g., Development vs. Production) consistently across both Blazor Server and WebAssembly.
BasePath: Automatically renders the <base href="..."> tag, which is particularly helpful for apps hosted under subpaths (e.g., /dashboard/).
Navigation & Interaction
Relative Navigation: NavigationManager.NavigateTo and the NavLink component now support a RelativeToCurrentUri parameter. This allows you to navigate relative to the current page path rather than the app's root.
QuickGrid OnRowClick: The QuickGrid component now has a native OnRowClick event. When used, it automatically applies a pointer cursor to rows and handles the click callback.
Startup & Configuration
Unified Startup Format: The Blazor.start() options object format introduced for Blazor Web Apps in .NET 8 is now supported for standalone Blazor Server and Blazor WebAssembly scripts.
IHostedService in Wasm: Blazor WebAssembly now supports IHostedService, allowing you to run background services directly in the browser.
ASP.NET Core Core Framework
Performance & Observability
Native OpenTelemetry Tracing: ASP.NET Core now builds OpenTelemetry semantic attributes directly into HTTP server activities. You no longer need a separate instrumentation package to collect standard trace data.
Kestrel Hardening: The HTTP/1.1 parser has been reworked to handle malformed requests more gracefully, resulting in a 20–40% throughput improvement in high-invalid-traffic scenarios (like port scanning).
APIs & Tools
OpenAPI 3.2.0: Support has been updated to the latest specification, though this includes some breaking changes for client generators.
Web Worker Template: A new dotnet new webworker project template allows Blazor Wasm apps to easily offload heavy computations to a background Web Worker.
Metrics & Tracing: New built-in metrics have been added for Blazor WebAssembly to track component render times and performance.
Runtime & SDK
Runtime-Native Async: .NET 11 introduces "Runtime Async," which makes asynchronous calls a first-class citizen at the runtime level, leading to cleaner stack traces and lower overhead.
CoreCLR on WebAssembly: Significant progress has been made in migrating Blazor WebAssembly from the Mono runtime to CoreCLR, promising better performance and JIT support in the future.
No comments:
Post a Comment