.NET 10 Preview 5 highlights C# 14, runtime improvements

Microsoft has launched the fifth preview of its planned .NET 10 open source developer platform. The preview release fits C# 14 with user-defined compound assignment operators and enhances the .NET runtime with escape analysis, among other updates.

Announced June 10, .NET 10 Preview 5 can be downloaded from dotnet.microsoft.com. It includes enhancements to features ranging from the runtime and C# 14 to F# 10, NET MAUI, ASP.NET Core, and Blazor.

C# 14 type authors can now implement compound assignment operators in a user-defined manner that modifies the target in place rather than creating copies. Pre-existing code is unchanged and works the same as before. Meanwhile, in the .NET runtime, the JIT compiler’s escape analysis implementation has been extended to model delegate invokes. When compiling source code to IL (intermediate language), each delegate is transformed into a closure class with a method corresponding to the delegate’s definition and fields matching any captured variables. At runtime, a closure object is created to instantiate the captured variables along with a Func object to invoke the delegate. This runtime preview also enhances the JIT’s inlining policy to take better advantage of profile data. Additionally, F# 10 introduces scoped warning controls with a new #warnon directive supporting fine-grained control over compiler diagnostics.

A production release of .NET 10 is expected this November. .NET 10 Preview 5 follows Preview 4, announced May 13. The first preview was unveiled February 25, followed by a second preview on March 18, and the third preview, announced April 10. Other improvements featured in Preview 5 include:

  • For ASP.NET Core, developers now can specify a custom security descriptor for HTTP.sys request queues using a new RequestQueueSecurityDescriptor property on HttpSysOptions. This enables more granular control over access rights for the request queue, allowing developers to tailor security to an application’s needs.
  • The OpenAPI.NET library used in ASP.NET Core OpenAPI document generation has been upgraded to v2.0.0-preview18.
  • Blazor now provides an improved way to display a “not Found” page when navigating to a non-existent page. Developers can specify a page to render when NavigationManager.NotFound() is called by passing a page type to the Router component using the NotFoundPage parameter.
  • For .NET MAUI, projects now can combine XML namespaces into a new global namespace, xmlns="http://schemas.microsoft.com/dotnet/maui/global", and use these without prefixes.
  • For Windows Presentation Foundation, the release introduces a shorthand syntax for defining Grid.RowDefinitions and Grid.ColumnDefinitions in XAML, with support for XAML Hot Reload. Performance and code quality are also improved.
Total
0
Shares
Previous Post

Cisco underscores AI commitment with networking LLM, agentic AI interface

Next Post

Meter secures $170 million to scale NaaS stack from the ground up

Related Posts