Inside .NET 10 Preview 2: What Matters for App Developers?!


As promised, today, I will share everything I know about the upcoming .NET 10 release later this year.

A few days ago, .NET 10 Preview 2 was released, and most information shared is based on it.

Runtime & Performance Improvements

With every .NET release, we get substantial performance improvements. It’s one of the things I love about the .NET platform.

By upgrading to the latest release every year, I get free performance improvements, resulting in faster applications or cost savings for applications running in the cloud.

I have to be honest, I don’t understand most of the low-level optimizations. And I believe it’s the way it should be. Regular application developers benefit from the work platform and library developers have put into it.

If you’re curious about some of the performance optimizations implemented with Preview 2, check out Array Enumeration De-Abstraction, Inlining of Late Devirtualized Methods, and Devirtualization Based on Inlining Observations.

​NativeAOT now supports casting and negation in type preinitializers. Again, it’s not the area of my expertise. I learned from reading the post that it further enhances the scenarios where we can use AOT.

.NET SDK

The .NET SDK gets a few new command aliases. Currently, we have the verb-first syntax like dotnet add package. With .NET 10, we get the noun-first version (e.g. dotnet package add) as an alias.

This means that both options will work, starting with .NET 10.

I think it helps beginners get started and is more consistent when looking at other CLIs. However, I also don’t think that this change provides massive value to the platform.

C# 14

With Preview 1, we already learned about Field-backed properties that provide a smoother path from auto-properties to writing custom get and set accessors. The compiler-generated backing field can be accessed using the field keyword.

With partial events and constructors, we have another notable addition to C# 14 published with .NET 10 Preview 2.

In C# 13, we got partial methods and partial properties in addition to the partial classes introduced in C# 2.

With C# 14, we get new partial members with instance constructors and events.

I don’t think that this new feature will be often used by application developers. However, it opens up new opportunities for source generators.

ASP.NET Core & Blazor

I’m mostly excited about updates for ASP.NET Core and Blazor because I mostly do web development these days.

There are many new features, and you can learn about all of them in this GitHub discussion. I want to highlight the following changes that I think add the most value to my everyday work.

We get a new Reconnection UI component added to the Blazor Web App project template that improves the user experience in scenarios where the client loses connection to the Server in Blazor Server applications.

Another issue I personally faced will be fixed with .NET 10. The NavigateTo method of the NavigationManager no longer scrolls to the top of the page for same-page navigations.

Configurable Encryption Algorithm for PKCS#12/PFX Exports

The first notable update will be the option to configure the encryption algorithm when exporting certificates.

You can basically choose between the traditional encryption algorithm supported by most systems and a modern version using AES targeted at up-to-date systems.

It might be a niche topic, but this extension of the .NET libraries will be helpful to those in need.

.NET MAUI

I haven’t tried .NET MAUI for months or maybe years. For mobile scenarios, I prefer using Avalonia UI or Platform Uno.

Therefore, I won’t comment on new features or the general development of .NET MAUI.

Conclusion

With every preview version, I’m getting more and more excited about the upcoming .NET 10 release.

Maybe the excitement is a little higher than usual because of the release number. Or maybe, because it’s another LTS release and the previous LTS release .NET 8 was such a big step in the right direction - I don’t know.

I hope you’re as much looking forward to .NET 10 as I am.

Learn more about the new features in .NET 10 Preview 2 on the official Microsoft developer blogs.