Home > Net >  Exporting my .NET Framework WinForms app to Linux?
Exporting my .NET Framework WinForms app to Linux?

Time:01-06

For a project, I build a WinForms application using .NET 7.0. I noticed it must run on Linux so I made some research and found that it's possible to run .NET code with mono but it's not applicable to WinForms. Is there a solution to convert my project without having to make the design of the forms from scratch (like would be the case with mono development)?

Thanks.

What I tried: Installing mono and running my code. It says me that no CLI image was found.

CodePudding user response:

No cross-platform desktop GUI exists in .NET out of the box.

To overcome this issue Microsoft created MAUI although it was announced Linux devices won't get official support.

Your best bet would be to migrate to Avalonia or UNO, both are great open-source, free and feature-rich frameworks built on top of .NET which works on any operating system, including Ubuntu, macOS and Windows. Both frameworks use XAML dialect which should feel familiar for developers coming from WPF, UWP, or Xamarin Forms.

UNO can be developed using C# markup instead XAML

No XAML needed if you don’t want it – Enjoy a Flutter-like UI development experience with C# and .NET Hot Reload by using C# for Markup

CodePudding user response:

Only .NET 7 console app runs (through .NET 7 runtime) on Linux, no WinForms, no WPF.

If you need a .NET desktop app running on Linux, and you are targeting GNOME desktop environment, you could give a try to gtk# based on mono.

  • Related