.NET 10 Preview 5 Unveiled: Enhanced Developer Tools and Performance Boosts
Table of Contents
- .NET 10 Preview 5 Unveiled: Enhanced Developer Tools and Performance Boosts
Microsoft has released.NET 10 Preview 5, featuring a suite of updates designed to improve developer productivity and application performance across ASP.NET Core, .NET MAUI,Windows Presentation Foundation (WPF),and Entity Framework Core. The new preview introduces enhanced customization options, improved diagnostic tools, and streamlined coding processes, marking a significant step forward in the .NET ecosystem.
ASP.NET Core: Fine-Grained Security and Enhanced OpenAPI Support
The latest preview brings notable enhancements to ASP.NET Core, including the ability to configure custom security descriptors for HTTP.sys request queues.Developers can now manage access to request queues at the operating system level using the RequestQueueSecurityDescriptor property within HttpSysOptions, providing more granular control over application security 1.
OpenAPI generation now supports version 3.1, improving the integration of .NET applications with other services.The update also extends metadata extraction from XML documentation, recognizing <returns/> and <response></response> tags for more descriptive response documentation.
Did you Know? OpenAPI is a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or network traffic inspection.
Blazor Framework: Simplified “Not Found” Pages and Advanced Diagnostics
The Blazor framework introduces a streamlined method for rendering Not Found pages. By specifying a NotFoundPage component in the router configuration, developers can easily define custom 404 pages. This new approach is prioritized over the older NotFound fragment and is included in default project templates.
<router appassembly="@typeof(Program).Assembly" notfoundpage="typeof(Pages.NotFound)">
<found context="routeData">
<routeview routedata="@routeData"/>
<focusonnavigate routedata="@routeData" selector="h1"/>
</found>
<notfound>This content will be ignored as we have NotFoundPage defined.</notfound>
</router>
Blazor apps also gain detailed metrics and tracing capabilities. Metrics are published via dedicated meters for components, lifecycle events, and server circuits. Tracing uses a new Microsoft.AspNetCore.Components activity source,offering detailed instrumentation for navigation,event handling,and circuit lifecycles.
builder.Services.ConfigureOpenTelemetryMeterProvider(meterProvider =>
{
meterProvider.AddMeter("Microsoft.AspNetCore.Components");
meterProvider.AddMeter("Microsoft.AspNetCore.Components.Lifecycle");
meterProvider.AddMeter("Microsoft.AspNetCore.Components.Server.Circuits");
});
builder.Services.ConfigureOpenTelemetryTracerProvider(tracerProvider =>
{
tracerProvider.AddSource("Microsoft.AspNetCore.Components");
});
.NET MAUI: Streamlined XAML and Enhanced Web Request Handling
.NET MAUI receives support for XAML Global and Implicit Namespaces, simplifying markup by allowing developers to use controls without specifying multiple xmlns declarations.A new global namespace can include custom views, converters, and third-party libraries, resulting in cleaner and more maintainable XAML. Implicit namespaces can be activated through project properties, reducing the need for verbose declarations.
The HybridWebView now supports intercepting web requests via the WebResourceRequested event. This enables developers to alter or block requests,facilitating scenarios such as injecting custom headers or serving local resources.
<hybridwebview webresourcerequested="HybridWebView_WebResourceRequested"/>
WPF: Concise Syntax and Improved Performance
WPF introduces a shorthand syntax for grid.RowDefinitions and Grid.ColumnDefinitions, making XAML more concise and improving Hot Reload support. Font and globalization enhancements include the addition of the simsun-extg font to improve rendering in East Asian languages. The Fluent theme has been refined, addressing crashes and improving styling for RTL layouts. Performance gains were achieved by reducing memory allocations and removing unused code paths.
Entity Framework Core 10: Custom Default Constraint Names
Entity Framework Core 10 Preview 5 allows developers to define custom names for default constraints, providing more control over database schema generation. Constraint names can be assigned directly in model configuration or enabled automatically for all default constraints using UseNamedDefaultConstraints.
Summary of key Updates in .NET 10 preview 5
| Feature | Description |
|---|---|
| ASP.NET Core Security | Custom security descriptors for HTTP.sys request queues. |
| OpenAPI Support | Version 3.1 support and enhanced XML documentation extraction. |
| Blazor Framework | Simplified Not Found pages and detailed metrics/tracing. |
| .NET MAUI | XAML Global/Implicit Namespaces and web request interception. |
| WPF | Concise syntax for grid definitions and performance improvements. |
| Entity Framework core | Custom names for default constraints. |
Pro Tip: Regularly updating to the latest .NET previews allows developers to leverage cutting-edge features and contribute to the platform’s ongoing development through feedback and bug reporting.
The.NET 10 Preview 5 delivers a range of improvements and new features across key .NET components. These updates aim to enhance developer productivity, application performance, and customization options, making .NET an even more powerful platform for building modern applications.
What new feature are you most excited to try in .NET 10 Preview 5? How do you plan to leverage the enhanced diagnostic tools in your Blazor applications?