.NET 10 Preview 1: A Sneak Peek at What's Coming
Even though .NET 9 was released in November 2024, only a few months ago, we are already on the path to .NET 10, coming later this year.
Today, we want to take a look at what we know today will come with .NET 10.
The information shared is based on the .NET 10 Preview 1 release, which happened on February 25th and focused on things interesting to .NET developers.
New Method Overloads for DateOnly
There are new ISOWeek overloads for the DateOnly type. Those methods allow developers to work with the number of weeks a year.
Up to .NET 9, the ISOWeek class exclusively provides extension methods targeting the DateTime type. With .NET 10, we will get new methods targeting the DateOnly type.
String Normalization APIs for ReadOnlySpan<char>
We already have string normalization APIs for the string type. With .NET 10, we will get those string normalization APIs also for the ReadOnlySpan<char> type.
This new feature is especially helpful in reducing the allocation of strings in scenarios where string normalization needs to be performed efficiently.
Performance Improvements for ZipArchive
Two community contributions help reduce memory usage and increase the performance of the ZipArchive class.
Previously, when having to create zip archives, relying on the built-in types wasn’t the best option (not only) because of its performance compared to other solutions.
The benchmarks shown with the release of .NET 10 Preview 1 promise a considerable reduction in execution time, especially for adding files to an existing archive.
Pruning of Framework-provided Package References in the SDK
With .NET 10, the NuGet Audit feature will be able to prune framework-provided package references that are not used by a project.
This will help reduce the number of packages required to restore during the loading of a project or building on the server.
New C# 14 Features
We know only a few things about C# 14 at this point:
- The argument of a
nameofexpression can now be an unbound generic type, such asList<>. - New implicit type conversions between
Span<T>andReadOnlySpan<T>. - Modifiers on simple lambda paramters:
ref,in, orout.
ASP.NET Core & Blazor
We will get OpenAPI 3.1 support, including the option to generate OpenAPI documents in YAML format.
We will get a new API to detect if a URL is a local URL with the RedirectHttpResult.IsLocalUrl method.
For Blazor, we get a RowClass parameter on the QuickGrid component, which allows us to provide a CSS class to style the row.
The blazor.web.js file will be a static web asset with .NET 10 instead of an embedded resource. This will reduce the file size and improve caching.
Entity Framework Core
.NET 10 will add support for the LeftJoin operator in EF Core 10.
I only covered the most important bits and pieces that are important to me in this newsletter. If you want to dive deeper, the official .NET 10 Preview 1 blog post is the best starting point.
5 Rules Every Software Engineer Should Live By
I came across this 2-minute video explaining five rules/tips I agree with and thought it might be valuable to share with you.
