Microsoft drops 'Go Live' preview of .NET Core 3, complete with desktop app support
Fit for production if you are brave, but no Windows Forms designer yet
Microsoft has released .NET Core 3.0 Preview 7 and Visual Studio 16.3 Preview 1, which work together to enable new features including Windows desktop applications built with .NET Core and C# 8.0.
NET Core 3.0 is the first version of Microsoft's open-source, cross-platform fork of .NET that is able to target Windows Presentation Foundation (WPF) and Windows Forms, the two most commonly used frameworks for Windows desktop applications.
This does not mean those frameworks now work cross-platform; they are still Windows-only. It does, however, mean that on Windows .NET Core gains features like COM interoperability.
Why build desktop applications in .NET Core, rather than the trusty .NET Framework, especially if it is still Windows-only? One reason is that the .NET Framework is now kind of a legacy runtime and does not support C# 8.0, which is also nearing general availability.
Microsoft wants to play safe with .NET Framework and keep it compatible, so given that some new language features and APIs in .NET Core require runtime changes, they will not work on the .NET Framework. The official word on this is here, where program manager Immo Landwerth explains that new features in .NET Standard 2.1 will not come to the .NET Framework, which remains on .NET Standard 2.0.
Yes, there are multiple incompatible .NET standards.
This means developers need to move away from .NET Framework if they want to keep up with new language features. Eventually this will be an issue for popular libraries and components as well.
Microsoft has already announced that the version of .NET Core after 3.0 will be .NET 5.0, and it will lose the "Core" designation, underlining the legacy status of .NET Framework.
There is, of course, a downside. Yes, you can now build WPF and Windows Forms applications using .NET Core 3.0, but it is not quite the same WPF or Windows Forms framework that you are used to. Rather, they are (open-source) forks of those frameworks, with some APIs missing. Microsoft has a Portability Analyzer tool you can use as a guide.
Compatibility with .NET Core 3.0 is in fact good, with a notable exception being Windows Communication Foundation (WCF), which has not all been ported.
Configuring the .NET Portability Analyzer is a reminder of the many different .NET variants Microsoft has created
The Portability Analyzer is also a useful reminder of how many variants of .NET there are, including dead ends like Windows Phone and Silverlight.
Another benefit of making the switch is to take advantage of potential future improvements to WPF and Windows Forms now that these frameworks are open source. They have been near-frozen for years, with Microsoft pushing developers towards its Universal Windows Platform (UWP) instead.
.NET Core developers also have an option for self-contained deployment, which means that the runtime libraries are bundled with the application. We verified this by creating a Windows Forms application using .NET Core 3.0 and C# 8.0 features, publishing it to a folder using the self-contained option, and copying the folder to a Windows 7 PC. The application ran straight away.
There is also an option for "Framework dependent" deployment, which will use a system-wide installation of .NET Core 3.0.
.NET Core 3.0 Preview 7 has a "Go Live" licence, which means it is supported by Microsoft in production. This also implies that Microsoft does not expect to make many changes before general availability other than bug fixes, though Principle Program Manager Richard Lander said: "Notable exceptions are: WPF, Windows Forms, Blazor and Entity Framework" – a substantial list. For production use, Microsoft is likely thinking primarily of ASP.NET applications rather than these newer and less fully tested features.
You do need Visual Studio 16.3 Preview in order to use the latest .NET Core. Lander said in the comments to his post: "We don't believe that there is any risk in using VS 16.3 Preview from the standpoint of working on production apps." Windows Forms developers will, however, have to manage without a form designer when working with .NET Core 3.0, unless you create a multi-target project that can share forms created for .NET Framework.
One of the reasons Microsoft is anxious to move onto .NET Core 3.0 is better container support. The new version is container-aware and supports Docker memory limits and CPU limits. Details are here.
ASP.NET Core 3.0 is part of the same wave of releases as .NET Core 3.0 and Visual Studio 16.3. One of the features included is Blazor, which lets you build web user interface components using C#. Blazor can run on the server or in the browser. When running in the browser it uses WebAssembly. Server-side Blazor will be in ASP.NET Core 3.0, but client-side Blazor will remain in preview. Blazor is a route to a cross-platform GUI written in C# and running on .NET Core, using browser technology.
Overall, this is an important step in the transition to .NET Core as the mainstream version of .NET, though you can be sure that the Windows-only .NET Framework will stay around for the foreseeable. ®