.NET Core 3.1, .NET 5, C# 8.0 Support is on its way

ctodx
09 December 2019

Within the next couple of weeks, we will be publishing the v19.2.5 maintenance update to DevExpress Universal, with support for .NET Core 3.1 (LTS). It will include updated DevExpress assemblies built under .NET Core 3.0 - for the best user coverage. Doing so is also because the .NET Core runtime updates are compatible within a major version (for instance, our netcoreapp3.0 assemblies already support .NET 5 and .NET Core 3.1).

If you are a registered customer, we will notify you via email when the compatible components are ready for download.

Are There Any Breaking Changes in .NET Core 3.1?

Microsoft removed many APIs in .NET Core 3.1 – including System.Windows.Forms.ContextMenu, DataGrid, and DataGridLineStyle – APIs that we used internally. We have updated our code to remove these calls and are now finishing our tests.

If you target .NET Core 3.1 with your DevExpress WinForms v19.2.4 apps, you will receive exceptions (learn more). Our strong advice is to wait for our v19.2.5 update, or to target .NET Core 3.0 in order to avoid these issues. Note that if you update to the latest Visual Studio version, .NET Core 3.0 will be removed and superseded with .NET Core 3.1.

What About .NET Core 3.1 Support and  v19.1?

If you recall, we provided v19.1 NuGet packages with .NET Core 3.0 WinForms and WPF support in v19.1. However, due to the aforementioned breaking changes and the difficulties we encountered in updating our code, we will not support .NET Core 3.1 with v19.1.

What About .NET 5+?

We are already testing early .NET 5 builds in our development labs. With each preview build, we find that Microsoft are refactoring the WinForms internals, some changes larger, some smaller, and we obviously have to adjust/tweak/rewrite our code accordingly (an example: Reflection-related code). We are certainly excited about .NET 5 and we will be ready to publish our update alongside its release in November 2020.

Nullable Reference Types in C# 8.0

As you may have heard from the recent announcement, Microsoft is gearing up to adopt Nullable Reference Types (NRT) with .NET 5. They are encouraging developers – and library writers! – to embrace using NRTs sometime during the remaining time until .NET 5’s release date in November 2020 (the so-called “nullable rollout phase”), after which these nullable reference types will be the standard.

Hence, we, as .NET library authors, and you, as .NET library users, should start preparing right now. We are thinking about modifying our code to use nullable reference types in public/user APIs where null assignments are expected, for instance, using string? instead of just string. These modifications will work for .NET Framework 4.5.2 and .NET Core 3.0+ libraries in our tests. We will just need to switch source code to C# 8.0 for our libraries. This may affect a small fraction of users who rebuild our source code (they may require to install Build Tools for required Visual Studio version).

If you test NRTs in WPF projects, beware of the following known issue: https://github.com/dotnet/WPF/issues/2040 ("Partial declarations of 'MainWindow' must not specify different base classes").

What do you think about this C# 8.0 feature? What do you plan to do yourself (and how quickly?) and what are your expectations from DevExpress in this regard? Comment below or send me an email.

Some additional reading

https://dotnet.microsoft.com/download/dotnet-core/3.1

https://devblogs.microsoft.com/dotnet/announcing-net-core-3-1/

https://devblogs.microsoft.com/dotnet/embracing-nullable-reference-types/

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.