Running/Migrating a WPF application into Linux

WPF-Learner 106 Reputation points
2020-12-16T10:40:56.587+00:00

Hello,

We have developed a WPF application that is widely used by users who have the Windows operating system on their machines. Now, we would like to also reach users who use Linux.

What would be the best approach for such a migration?

I did a little research and found these following options:

Option 1: .NET Core 3.0’s support for WPF, a WPF application can run on Linux under Wine. Wine is a compatibility layer which allows Windows applications on Linux and other OSes, including .NET Core Windows applications.
I've discovered this possibility by reading the following article:
https://ccifra.github.io/PortingWPFAppsToLinux/Overview.html

When I showed this solution to my team members, they claimed that according to their past experience, Wine has some major performance pitfalls. Should I test it out or it's indeed not recommended for such a migration, according to your experience?

Option 2: I’ve also read about .NET MAUI, via this article on Microsoft blogs:
https://devblogs.microsoft.com/dotnet/introducing-net-multi-platform-app-ui/

I’m really not sure if .NET MAUI supports Linux, as the article only mentioned the Android, iOS, macOS, and Windows operating systems.
Is it possible to use it for migrating a WPF app into Linux?

If the options I’ve suggested are not great, what other options I might have for doing such a migration?

Thank you for your help and I’m looking forward to your reply,
Dima

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,671 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
762 questions
0 comments No comments
{count} votes

Accepted answer
  1. DaisyTian-1203 11,616 Reputation points
    2020-12-17T03:06:41.397+00:00

    Implementing WPF to run on Linux is difficult right now, and there is no documentation of this in Microsoft's official documentation. WPF uses DirectX and its package provides Windows-specific NuGet packages that are referenced by desktop projects on Windows only.

    In the first blog which you provided, it points out that most debuggers will not work to debug a .NET Core apps running under Wine.

    For your second option, the .NET MAUI doesn't support Linux now, you can see it in the December 2020 .NET Community Standup report. And I show you screenshot of this introduction from the video as below:
    48952-capture.png

    By the way, .NET MAUI is Multi-platform native UI which deploy to multiple devices across mobile & desktop, please refer to Introducing .NET Multi-platform App UI (MAUI) to get more details about it.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Teyar RAID Nasrellah 1 Reputation point
    2022-02-25T11:19:05.493+00:00

    I'm sorry if this is late but I got a similar situation and the best options I found are :

    1. Avalonia

    Avalonia is an open-source cross-platform framework that's very similar to WPF and can deploy to any platform (Windows, Linux, macOS, Android, and web assembly), and it supports MVVM very well: http://avaloniaui.net/

    1. Uno

    Uno is a bit similar to MAUI but it supports every platform "haven't used it so you can look into it more yourself": https://platform.uno/

    0 comments No comments