Microsoft will release .NET 8, a long-term support (LTS) version, at the .NET Conf 2023 between November 14-16.
A post from principal product manager Mehul Harry, which confirmed the timing, promises a focus on cloud native .NET, Blazor full-stack (meaning that both a browser-based client application and server code can be coded in .NET), .NET MAUI (Multi-platform App UI), and AI-based application development.
LTS releases of .NET arrive every two years and are supported for 3 years. The odd-numbered releases are supported for only 18 months. Even three years is hardly long enough to skip an LTS release entirely, so developers with .NET 6 applications in production should plan to upgrade. In some respects the near-frozen .NET Framework 4.8 is better for long-term support, since it will continue to be distributed and supported with Windows and is supported for the lifetime of those Windows releases.
The feature gap between .NET Framework and .NET (Core) will continue to widen though. There is a lot packed into .NET 8, including ahead of time (AOT) compilation for macOS (alongside Windows and Linux), and reduction in size of AOT-compiled apps on Linux by up to 50 percent.
C# in .NET 8 is upgraded to version 12, with new features including primary constructors, whose parameters are in scope throughout the class definition.
ASP.NET Core 8, perhaps the most used of the various key frameworks, has updates including automatic reconnect for SignalR, a real-time messaging library based on WebSockets (with fallback to other transport methods). Support for native AOT has been added, subject to some compatibility issues, and HTTP/3 support in Kestrel, the built-in web server. Authentication in SPAs (Single Page Applications) is streamlined. Blazor has a number of big updates, including a new server-side rendering (SSR) mode, smoother user experience by streaming updates into a web page without re-rendering the DOM (Document Object Model), and an option to render interactive components on the server or on the client via WebAssembly.
“You can make individual components or pages interactive by applying an interactive render mode: Server or WebAssembly, which correspond to the existing Blazor Server & Blazor WebAssembly hosting models. You can mix the Server & WebAssembly render modes in the same app and even change the render mode at runtime to transition from Server to WebAssembly. You no longer need to choose a Blazor hosting model up front: you just create a Blazor Web App and decide what render mode you want to use for your components,” said program manager Daniel Roth.
The changes in Blazor are so extensive that some developers feel left behind. “I’m trying to learn Blazor, but confused very much because of these changes” said one. Roth commented that Blazor is evolving into something similar to React Server Components, “except with Blazor you get to write C# instead of JavaScript.”
Another area of rapid change is MAUI, the cross platform desktop and mobile framework. The .NET 8 version has an extension for Visual Studio Code, enabling development on Windows, macOS and Linux, though Linux desktop applications are not supported. Native AOT for iOS is in development, with potential size reduction compared to Mono-based applications – Mono being the original Xamarin .NET runtime. However this is “still work-in-progress and only the first step towards making the feature ready for .NET 9 official release,” said cloud advocate Justin Yoo. Some developers are keen to move away from Mono. “Having both Mono and CoreCLR can create inconsistencies. We have encountered mono issues” said a mobile developer.
While Microsoft is keen to hype new features, it also remains true that developers care as much about reliability. “I wonder if they can stabilize .NET MAUI … this thing is a nightmare to use – every release introduces new regressions” commented a dev. Others observed that the Visual Studio IDE remains stuck on .NET Framework, despite the release of Windows Presentation Foundation for .NET Core.
MAUI is perhaps the most contentious area, with some developers questioning not only its reliability but also whether Microsoft’s direction is right, especially since it ties into WinUI. “Avalonia UI is the only one that is done correctly with its rendering back-end. (its only flaw has been poor IDE integration which is being addressed),” according to another observer.