Microsoft last month delivered the new .NET 6 Preview. This comes just a few months after the release of .NET 5.0 in November 2020. So here we’ll examine some of the major improvements you can expect in .NET 6.
.NET Multi-platform App UI
.NET Multi-platform App UI is a modern UI toolkit that builds upon and extends Xamarin. This allows you to deliver beautiful and consistent app experiences across various platforms and devices, as well as to share more code across mobile and desktop apps. With .NET Multi-platform App UI, you can target Android, iOS, macOS, and Windows.
Not only is the Xamarin.Forms toolkit integrated and extended, but also the Xamarin.Essentials library gets merged into .NET Multi-platform App UI. User device capabilities and common features are also made easier within .NET Multi-platform App UI.
.NET 6 Preview 1 introduces the first two platforms of .NET Multi-platform App UI, and they are Android and iOS. Future previews of .NET 6 will add support for macOS and Windows desktop.
To see the sample projects and installation instructions, have a look here.
Microsoft has made major improvements in Arm64 performance. For Windows, Microsoft is adding support for Windows Presentation Framework and Windows Forms apps, with initial support in Preview 1. For Mac, Microsoft is adding support for native and simulated Apple Silicon (Arm64) chips, with initial support in Preview 1.
Portable Thread Pool
The .NET thread pool has been re-implemented as a managed implementation in .NET 6. This is now the default thread pool in .NET 6 and also the standard for .NET going forward. This is to ensure that applications have access to the same thread pool — with identical behavior — independent of whether the CoreCLR, Mono, or any other runtime is being used. Because the thread pool has been written in .NET 6, it will be more accessible for experimentation and customization. You can still, however, revert to using the native-implement runtime thread pool with: COMPlus_ThreadPool_UsePortableThreadPool=0.
Crossgen2 (the replacement of the crossgen tool), which has been written in C#, is intended to satisfy two outcomes: make crossgen development more efficient, as well as to enable capabilities not currently possible with the older crossgen tool.
Crossgen2 enables cross-compilation across operating systems and architecture dimensions. This simply means that you will be able to use a single build machine to generate native code for all targets.
In .NET 5 and .NET 6, Microsoft has been improving performance for structs so that they can be loaded and accessed in CPU registers. The following struct changes are included in Preview 1:
This article has explored the improvements to previous .NET versions that culminates in .NET 6. There is still a lot to come, so stay tuned!