Microsoft on Monday launched .NET Core 3.0 and Visual Studio 2019 16.3 at its virtual .NET Conf that is under way this week.
The significance of .NET Core 3.0 is that it supports Windows desktop applications build with WPF (Windows Presentation Foundation) or Windows Forms, though on Windows only: this is not the long-awaited cross-platform GUI framework many are waiting for.
Along with desktop application support, .NET Core 3.0 adds COM-callable components. Although not much talked about now, COM remains deeply embedded in Windows development so the ability to use .NET Core in COM-callable libraries is critical.
The advent of .NET Core desktop support is not just about giving desktop developers another .NET option. It also means that WPF and Windows Forms, both of which are still widely used for business applications, are more likely to be further developed. These frameworks were largely left behind when Microsoft built Windows 8 and started down the path to Windows Runtime and then UWP (Universal Windows Platform) development. Much of that strategy has been unwound in Windows 10, and now Microsoft seems happy to present UWP as one option among many for desktop development. WPF and Windows Forms are now open-source in their .NET Core versions.
(Speaking of open source, and as an aside, Microsoft opened up the code to its implementation of the C++ Standard Library this month.)
There are also key changes in .NET Core 3.0 affecting the way applications are compiled and deployed. It now compiles framework-dependent executables by default, meaning an executable that relies on a globally installed .NET Core installation. There is also an option to compile a single file executable which includes all its dependencies, including the .NET Core runtime. These get unpacked into the application folder on first run. It is a simple way to deploy and works on Windows, Linux and macOS.
System.NET in .NET Core 3.0 supports HTTP/2. .NET Core will also now use TLS 1.3 security when available. Support for the Google-developed gRPC protocol is built into .NET Core 3.0 – that's significant for microservices development and assisting interoperability.
Arm64 Linux is also now supported. The docs state that this is primarily for IoT support. Arm64 Windows support is not yet available though. The full list of new features is here.
There is more new stuff in the related frameworks though. In particular, Blazor, which lets you use C# that runs in the browser with WebAssembly, is part of ASP.NET Core 3.0. You also get Entity Framework Core 3.0 which adds Cosmos DB support (Microsoft’s flexible multi-model cloud database manager) and the ability to consume database query results as asynchronous streams.
Finally, here's something to bear in mind when installing the SDK:
If you installed the .NET Core 3.0 SDK manually it will uninstall all the preview versions. The VS based install doesn't appear to do this, so you need to manually clean up.— Barry Dorrans (@blowdart) September 24, 2019
C# 8.0 full release
This release also marks the official availability of C# 8.0, which introduces new features into the premier .NET language. The biggest changes in C# 8.0 are nullable reference types and default implementations of interface members. The point about nullable reference types is that references types are not nullable unless declared as a nullable type, using the query symbol. The idea is to make null reference exceptions, a common issue, less likely. For example:
string s maynotbenull;
string? s maybenull;
If the compiler detects that you are assigning null to a non-nullable type you will get a warning, though by default the code will still compile. Since this is a breaking change, the feature is off by default, but new project templates in Visual Studio 2019 will set it on automatically.
Default interface members let you add both members and an implementation of those members to interface types. It is a strange one since conceptually the whole idea of interface types is that they do not include an implementation. The thinking, though, is that this lets you add a default implementation to existing code that implements an interface. Java has this feature, too, as does the Swift language with default protocol implementation, so this change improves interoperability.
C# 8.0 also supports creating and consuming asynchronous streams, which among other things enables the async stream support in the Entity Framework mentioned above. The full list of what’s new in C# 8 is here.
And finally, Microsoft has delivered Visual Studio 2019 16.3 and Visual Studio for Mac 8.3. These add support for .NET Core 3.0 along with a number of other new features, including Android Q support for Xamarin Android apps.
The Windows-only .NET Framework, which is installed and serviced as part of Windows, remains supported and will be for the foreseeable future. In fact, Visual Studio 16.3 also adds support for .NET Framework 4.8. Most new features though will be in .NET Core only and the release of .NET Core 3.0 marks the moment when .NET Framework is shunted into the legacy corner.
Supported operating systems are Windows 7 SP1 and higher, macOS X 10.13 and higher, and various versions of Linux. Lack of an official GUI framework means that non-Windows development is mostly for server deployment, with Mac support more important for developers rather for deployment. Linux deployment is the norm for containerised workloads, a big change from when C# was for Windows only. ®