This article is more than 1 year old
Feeling saucy? Wave of Microsoft releases includes go-live licence for .NET 6
On track for November release, but why is ASP.NET more loved than wanted?
Microsoft has released another wave of previews for its .NET technology stack, but this time including a go-live licence for .NET 6 that enables brave users to deploy to production.
.NET 6 is significant, since it is a long-term support (LTS) release, the first since .NET Core 3.1 in December 2019. It is therefore the first LTS release since the company "unified" .NET. Microsoft plans that every even-numbered release will be LTS, meaning one every two years (an LTS release cadence that Java may be about to match.
Although .NET 6 RC1 is supported in production, program manager Richard Lander said that interested businesses should email Microsoft for guidance, suggesting that it is not expected to be a mainstream option.
Lander said there are no new features in the languages and compilers since the last preview, though he noted work done with Red Hat to create source tarballs (source files packaged into a single archive file) automatically as part of Microsoft's build process, to conform to the requirements of Linux distributions.
He also said that an increasing proportion of the .NET SDK is optional. In .NET 6.0, MAUI (Multi-platform App UI), Android, iOS and WebAssembly support is delivered separately from the SDK as an "SDK Workload."
In some future version, Lander said, "one can imagine the SDK containing only MSBuild, NuGet, the language compilers and workload acquisition functionality."
While the features of the runtime have not changed, the same is not true of ASP.NET. Principal program manager Daniel Roth listed 18 major new features or updates in the new preview.
The SignalR framework used for WebSocket communication in Blazor Server falls back to polling the server if WebSockets are not available, a much slower technique. In .NET 6 "we've disabled the long-polling transport for Blazor Server apps by default," said Roth, implying that it may be better for users to see an error than to suffer bad performance.
There are also some improvements to ASP.NET Minimal APIs, first described here.
These APIs reduce the amount of code required to get a working web application or API. New in this release are additions to the API for generating OpenAPI documents. There are also simplifications for developer exceptions pages and for setting configuration options.
The thinking behind Minimal APIs seems to be that getting started with an ASP.NET application involves too much ceremony, code which is required by the framework just to get it working. The Startup.cs file, previously part of the standard template for a C# web application, has been eliminated. Microsoft may be conscious that despite its energetic development, .NET appears to be losing ground to other frameworks in terms of popularity.
According to W3techs, ASP.NET powers 8.3 per cent of websites, compared to PHP at 78.8 per cent. In 2010, ASP.NET had a 24.4 per cent share and has steadily declined since.
Figures like these should be treated with caution as they may partly reflect the popularity of PHP-driven content management systems such as WordPress, rather than the enterprise custom applications Microsoft cares about most. Nevertheless, there is concern about .NET developer demographics, which seem to be skewed towards more experienced developers.
- Faster .NET? Monster post by Microsoft software engineer shows serious improvements
- Microsoft emits last preview of .NET 6 and C# 10, but is C# becoming as complex as C++?
- Microsoft: Try to break our first preview of 64-bit Visual Studio – go on, we dare you
- Microsoft flips request to port Visual Studio Tools for Office to .NET Core from 'Sure, we'll take a look' to 'No'
The Minimal API may help by making it easier to get started; yet even with these changes, .NET cannot compete with the one line of code needed for Hello World in PHP.
The MAUI SDK has been updated in this preview to align with ASP.NET and Blazor for how applications are constructed (the Host Builder pattern). There is also a new default to Android 12 for Android applications.
Visual Studio 2022 has also been updated to Preview 4. Principal program manager Mads Kristensen described several improvements, including up to three times faster "find in files", new debugger features, and many fixed issues for Blazor development.
There is new support for hot reload – update without a full re-compile – in ASP.NET Core. Developers can also now colour-code tabs by project, which is "especially useful for files that share the same name," said Kristensen.
Microsoft plans to release .NET 6 on 9 November at its .NET Conf online. Before then, there will be another release candidate, again with a go-live licence, according to Lander, though likely with fewer new features than in today's release. After that? Profile Guided Optimization for custom applications will be in .NET 7, Lander said, but he also stated that .NET 6 "will lay the foundation for what's coming next."
This release is the completion of establishing .NET Core as an open-source, cross-platform system, he claimed, whereas the next one will see the platform move forward in "both obvious and non-obvious ways."®