Microsoft has shipped the first “go live” version of .NET 5.0, intended to be a “unified platform” targeting Windows, Linux, macOS, iOS, Android, and more.
Although the latest release is supported in production, it is still a release candidate. “We’re looking for reports of any remaining critical bugs that should be fixed before the final release,” said senior program manager Richard Lander.
Production is for the brave. Visual Studio coders will require version 16.8, another preview. One more factor is that .NET 5.0 is not a long-term support (LTS) release. More cautious developers will want to wait for .NET 6, expected in November 2021.
The term .NET Core is being dropped. This is now just .NET, and Microsoft will no longer make significant updates to .NET Framework, the original Windows-only variant of .NET, and .NET 5.0 supports Windows Forms and Windows Presentation Foundation on Windows.
.NET 5.0 includes new language versions: C# 9.0 and F# 5.0. Visual Basic developers also get an upgrade, with .NET 5.0 supporting more VB project types, including Windows GUI applications and ASP.NET Core Web API. Also new in .NET 5.0 is single file applications, ARM64 targets, and what Microsoft claims are significant performance improvements.
Along with .NET 5.0, the company has updated ASP.NET Core (web applications) and Entity Framework Core (database object-relational mapper). In ASP.NET, Blazor WebAssembly applications run two to three times faster in “most scenarios”, according to principal program manager Daniel Roth.
ASP.NET Web API also gets on-by-default support for the Open API Specification via an open-source project called Swashbuckle. Web API projects are growing in importance, thanks to increasing interest in single-page applications and in JAMStack, which combines static websites with dynamic content rendered in the browser by calling web APIs, avoiding the need for server-side page generation. Microsoft is also hooking more deeply into Azure API Management, with the ability to publish ASP.NET Web APIs directly to the service.
Developers using Microsoft’s SignalR framework for real-time communications can now use the MessagePack protocol, a binary serialisation formation that is smaller and therefore more efficient than JSON.
Entity Framework Core 5.0 is also now available in release candidate form. EF Core 5.0 will run on .NET Core 3.1, the last LTS release, as well as 5.0. A big new feature in EF Core 5.0 is support for many-many relationships without having to manually specify a join table. This type of relationship is common in real-world databases, and the feature is long overdue.
Also new is that SaveChanges, used to update a database, now triggers a .NET Event which developers can handle in their code. There is also now support for using multiple database contexts with code-first migrations. A database context is EF’s primary abstraction of a database, with methods that let you access and update data, and the change means that you can use the same table in multiple database contexts without it breaking the ability to modify a class and have this automatically update the database structure. There are more changes in EF Core 5.0 as documented here by senior program manager Jeremy Likness.
There are some caveats with the new releases. The Windows Forms designer for Visual Basic projects is missing, promised for the forthcoming RC2. There are also niggling issues with Microsoft’s .NET strategy which is not altogether unified.
Take Mono, the original cross-platform .NET, for example. Lander said: “There are two variants of Mono now, the one in dotnet/runtime that is the future of Mono (and currently only used for web assembly) and the the one in mono/mono that is used for everything else. Xamarin use cases will move to using the Mono in dotnet/runtime in 6.0.” There is another rabbit-hole of complexity around UWP (Universal Windows Platform), WinRT (Windows Runtime) and WinUI (next-generation Windows GUI framework), the future of which comes under the Project Reunion umbrella.
Unified .NET is work in progress then; but “go live” .NET 5.0 is a significant milestone – even if actually using it in production sounds like a risky proposition. ®
Rojenx is a leading concept artist who work appears in games and publications
Check out his personal gallery here