.NET 10 Preview 6 - It's Getting Closer!


A few days ago, Microsoft released .NET 10 Preview 6. It’s a good opportunity to look at what’s new for us .NET developers.

It’s less than 4 months until the official release of .NET 10, and the last two months are traditionally used for bug fixes and won’t bring us new features - It’s Getting Closer!

JSON Serialization

We get two interesting new features for JSON serialization. There is a new option to disallow duplicate JSON properties.

The AllowDuplicateProperties property can be set on the JsonSerializerOptions type.

It’s funny, I once had this exact issue when multiple values were provided for the same JSON property. I asked myself how that case should be handled. And there is no formal specification for that behavior. Also, it’s considered a security risk.

Therefore, I’ll probably enable this feature in the future, since I don’t see a case where I want to have multiple JSON properties with the same name containing different values.

SDK - .NET Tools

.NET Tools can now be published as a single package for multiple platforms. The .NET CLI will automatically select the correct version at install or run time.

This will definitely simplify tooling development for cross-platform tools.

Another new feature is the option to run a .NET tool without installing it. The dotnet tool exec command executes a tool a single time. It’s probably most useful for CI/CD scenarios or one-off migration-type tooling.

There is also a dnx shortcut for typing dotnet tool exec all the time.

Blazor & ASP.NET Core

There are multiple improvements and new features for Blazor and ASP.NET Core.

What’s interesting for Blazor WebAssembly projects is the addition of the LinkPreload component, which provides us with better control over preloading.

Another interesting feature is the WasmBundlerFriendlyBootConfig property for the project file. With this project setting, JavaScript output uses the import semantic, allowing bundlers, such as Webpack or Rollup, to process the created JavaScript code.

Blazor Server apps get the option to persist state when a circuit is closed. If the client reconnects, the state can be reinstantiated from memory or a HybridCache. I’m curious to learn more about this feature since it promises to significantly improve the user experience.

We also get support for passkey authentication in ASP.NET Core Identity.

Other News

Besides the things mentioned here, there are further runtime improvements, such as improved loop inversion or improved code generation for struct arguments.

However, as I stated earlier this year, I’m not a low-level programming expert, and I don’t really understand how those things work. Feel free to explore those changes yourself.

For me, all that matters is that it will make .NET 10 the fastest .NET ever.

Learn more about all the new features and improvements coming with .NET 10 Preview 6 on the .NET developer’s blog.