Aimed at unifying the .NET platform, .NET 5 brings improvements to RyuJIT code quality, garbage collection, and JSON serialization, for starters.
Microsoft’s seventh preview of .NET 5 has arrived, with improvements in areas such as JSON and the Ryujit compiler. .NET 5 is a merger of .NET Framework and .NET Core that is intended to unify the .NET platform. The new platform is due for general availability November 10, 2020.
Microsoft had said that .NET 5 would be feature-complete by Preview 7. But two feature areas, single file and ARM intrinsics, are taking more time. Completion of these will wait until the planned eighth and final preview. Two release candidates will follow Preview 8.
High-level goals for .NET 5 include providing a unified .NET SDK experience, with a single BCL (base class library) across all .NET 5 applications, and with support for both native and web applications across multiple operating systems. A single .NET 5 native application project would support targets such as Windows, Microsoft Duo (Android), and Apple iOS using native controls on those platforms.
Additional goals of .NET 5 include support for building high-performance cloud applications, faster algorithms in the BCL, better support for containers in the runtime, and support for HTTP3.
.NET 5 Preview 7 arrived on July 21. A bulletin pertaining to Preview 7 acknowledges about 250 performance-oriented pull requests in .NET 5 and notes that a pleasant surprise is in store for those who have followed .NET Core performance. Other additions and improvements noted in the .NET 5 Preview 7 bulletin:
- The new System.text.json JSON API provides the ability to ignore default values for value-type properties when serializing, useful for reducing serialization and wire costs. This is a breaking change. Also added for System.text.json is the ability to deal with circular references when serializing, with API shape now expected to be final.
- Garbage collection now exposes detailed data on the most recent collection, using the
GetGCMemoryInfo
method, which returns aGCMemoryInfo
struct.GCMemoryInfo
serves information about machine and heap memory and the most recent collection, or the most recent collection of the kind of GC specified — ephemeral, full blocking, or background. The most likely use cases for this API are logging/monitoring or to indicate to a load balancer that a machine should be taken out of rotation to request a full GC. Another GC change, meanwhile, was made to defer the expensive reset memory operation to low-memory situations. - Ryujit, the assembly code generator for .NET, gains enhancements ranging from enabling the eliding of some bounds checks to tail duplication improvement and improvements for removal of redundant zero inits. Also featured in Ryujit are ARM64 hardware intrinsics and API optimization.
.NET 5 Preview 6, released June 25, removed built-in support for WinRT (Windows Runtime), a collection of APIs for building Universal Windows Platform applications. This is a breaking change; .NET Core 3.x apps using WinRT must be recompiled. The .NET and Windows teams have been working to change the way WinRT works with Windows, replacing WinRT support with the C#/WinRT toolchain in .NET 5. C#/WinRT is a NuGet-packaged toolkit offering WinRT projection support for C#.