Last week Microsoft released the sixth preview of the .NET 9 framework, introducing several updates across the .NET Runtime, SDK, libraries, C#, and frameworks such as ASP.NET Core, Blazor, and .NET MAUI. As stated, this release aims to enhance performance, improve developer experience, and expand functionality.
The stable version of the .NET 9 framework, is expected to be released later this year, and it is a Standard Term Support (STS) release that will be supported on multiple operating systems for 18 months, from November 12th, 2024, to May 12th, 2026.
The latest preview includes several notable improvements in .NET Libraries. System.Numerics sees several enhancements, and the Logging Source Generator now supports Primary Constructors. System.Text.Json receives multiple updates, such as a new JsonSchemaExporter, recognition of nullable annotations, and new contract metadata APIs.
Also, the GeneratedRegex attribute can now be applied to properties, and a new EnumerateSplits method has been introduced for Regex to simplify splitting various collection types.
Additionally, with the release of the sixth preview developers can now benefit from a generic OrderedDictionary, also ReadOnlySet<T> has been introduced for creating read-only wrappers around ISet<T>.
Other improvements include support for collection lookups with spans, more span-based APIs like StartsWith and EndsWith, optimized Base64Url encoding and decoding, SocketsHttpHandler as the default in HttpClientFactory, and TLS resume with client certificates on Linux.
Also, System.Diagnostics.Metrics now provides the Gauge instrument according to the OpenTelemetry specification. As reported, the Gauge instrument is designed to record non-additive values when changes occur.
The .NET Runtime in this preview offers several updates. ARM64 Code Generation now includes the ability to store operations. RyuJIT's block reordering algorithm has been simplified for better code layout, and interesting loop optimizations have been implemented to reduce code size and improve performance. Readers are encouraged to look into release notes for more details.
Address exposure has been minimized through enhancements in RyuJIT's tracking of local variable addresses. The release also introduces support for AVX10v1, a new SIMD instruction set from Intel, and includes improvements in hardware intrinsic code generation and constant folding for floating point and SIMD operations.
Furthermore, the .NET 9 Preview 6 SDK introduces new features aimed at enhancing security and build processes. NuGetAudit now raises warnings for vulnerabilities in transitive dependencies and a new command, dotnet nuget why, has been added to help developers understand the use of transitive packages in their projects.
Additionally, MSBuild BuildChecks have been introduced to enforce rules and invariants during builds.
C# 13 introduces partial properties, which, similar to partial methods, primarily support source generators. These additions build upon the improvements made in C# 9 to partial methods, offering more flexibility for developers.
ASP.NET Core in this preview includes several enhancements. Static web assets now feature fingerprinting to prevent the use of stale assets and improve caching behavior for faster load times. SignalR benefits from improved distributed tracing with a new ActivitySource named Microsoft.AspNetCore.SignalR.Server that emits events for hub method calls.
Furthermore, the Microsoft.AspNetCore.OpenAPI library has been enhanced with support for Required and DefaultValue attributes and schema transforms on OpenAPI documents. New analyzers warn developers when Authorize is overridden by AllowAnonymous, and several other analyzers have been added.
Additionally, the ComponentPlatform has been renamed to RendererInfo, and Kestrel will now split HTTP/2 headers that are too large for a single HEADER or CONTINUATION frame.
Interested readers can find more information about this release in the official notes. Lastly, the .NET 9 Preview 6 download is available for Linux, macOS, and Windows.