Hesam Seyed Mousavi, August 31, 2018
Perhaps Microsoft is listening after all, but it could still listen a little harder. A low key, and almost unnoticed, announcement at Build 2018 reveals that .NET Core 3 will support a GUI – but only on Windows.
Since Microsoft open sourced .NET things have been a little strange in the .NET world. The open source .NET Core is cross-platform and this is good, but it doesn’t have most of the infrastructure you need to write a Windows application. In particular, it lacks any sort of UI framework. This means that while it is ok for creating cross-platform command line programs and services, it isn’t up to the bulk of previous .NET programming tasks.
Despite being encouraged to see .NET Core as the future of .NET, most Windows-based .NET programmers really couldn’t make use of it. If anything it just caused fear and confusion because the future clearly wasn’t theirs.
Adding a GUI to .NET Core has been suggested for a long time and now it seems version 3 will get this facility. This is good news, but the Microsoft team can’t help but push the marketing angle of WinRT and UWP controls in particular. This also makes it difficult for them to state clearly what is going on. No matter what the announcement might headline as being important, what is really important is that it seems that both WPF and Windows Forms will be supported.
This is good news because WPF is still a contender for the title of most sophisticated UI Framework available, and the idea that Microsoft is more or less abandoning it in favor of an underdeveloped UWP Framework is depressing. Windows Forms, on the other hand, is never going to win prizes, but it is simple and been around since Windows started.
As the announcement points out, WPF depends on DirectX for its graphics and Windows Forms uses the GDI+, neither of which are cross-platform. So how can .NET Core incorporate WPF and Windows Forms? The answer is “Desktop Packs”. You install .NET Core 3 and then augment it with Desktop Packs that only work under Windows so making the whole thing Windows-specific.
Of course DirectX and GDI are not part of the Packs and are to be provided by Windows – specifically by Windows 10.
So can we expect our existing applications to just work? It seems we can:
We have a version of Paint.NET running in our lab. In fact, we didn’t have access to Paint.NET source code. We got the existing Paint.NET binaries working on .NET Core. We didn’t have a special build of WPF available, so we just used the WPF binaries in the .NET Framework directory on our lab machine. As an aside, this exercise uncovered an otherwise unknown bug in threading in .NET Core, which was fixed for .NET Core 2.1. Nice work, Paint.NET!
On reflection this doesn’t seem so surprising. After all, .NET Core 3 is supposed to be an open source version of .NET Standard and if this wasn’t so it would be a poor copy at best.
There are a few other extras. It appears that EF6 (Entity Framework 6) is to be included and UWP. In addition, WPF will be able to host UWP controls – not sure why.
Just in case you are interpreting this as WPF and Windows Forms are being open sourced, this isn’t the case. At the moment, it seems no decision has been made, but on past evidence there is a lot of resistance to open sourcing WPF in particular. However, if Microsoft really is listening and not just following its own path for reasons that most .NET programmers have little interest in, then it would do well to open source WPF. It would drive new development and breath life into a worthy UI Framework and perhaps fix some of the damage already done.
So let’s step back for a moment and evaluate what has just happened because the hype gets you excited even if the reality isn’t so interesting:
- We started off with .NET, Windows Forms and WPF working on Windows – most versions.
- We open sourced .NET and created .NET Core which didn’t have a GUI.
- We now add Windows Forms and WPF to .NET Core but only on Windows.
- So now we have .NET (Core) working with Windows Forms and WPF working on Windows 10.
A long road to get back to not quite where we started and, oh yes, .NET Core still doesn’t have a GUI unless it is working on Windows.
Without a cross-platform GUI, .NET Core is largely irrelevant to non-Windows programmers.
Microsoft still doesn’t seem to have recovered from its madness and now you have to think that the people steering aren’t even clear where they have come from, let alone where they are going.