How to port C # applications from windows for Linux?

The Windows.Forms library contains many errors that effectively prevent applications from working. WinForms Designer cannot install the WebBrowser control on the form. The NotifyIcon class does not work in LXDE (see KeePass's Bugtracker). The Clipboard class is not compatible with the default Calculate Linux manager. Drag and Drop have problems in DockPanelSuite. WinForms Designer is not completed due to problems with opacity. WPF has never been implemented and has no plans to do so.

And the mono team says: "We do not want to develop WinForms, because it is an old technology."

How to port a C # desktop application from Windows to Linux? Overwriting it with gtk # seems too complicated ...

Which is easier - fix mono WinForms, implement WPF or rewrite all the applications in the world to Gtk #?

+5
source share
1 answer

As you already learned, the Mono WinForms implementation is only suitable for very simple applications. Take a look at the โ€œCross-Platform Desktop User Interfacesโ€ on a blog by Xamarin employee Mike James, who summarizes the available solutions:

  • Traditional approach
    WPF or the WinForms interface on Windows, GTK # frontend on Linux, and Xamarin.Mac on Mac OS X. IMO is the best way to go, and it may be easier than it looks if you have correctly separated the business and presentation levels in your application.
  • XWT
    The XWT toolkit uses the same API and provides an appearance on all platforms, but only a limited set of components. Its usability for your projects depends on what components you really need.
  • HTML interface
    Create an external HTML interface using a simple WebView or Awesomium HTML UI Engine . In some cases, this may be a viable option, but I'm not sure if systray icons can be implemented with this approach.
  • QTSHARP
    An open source project that aims to implement .NET bindings for the multi-platform QT โ€‹โ€‹toolkit. I have never tried, but according to the project website, it seems to be at an early stage and is currently only tested on Windows.

BTW I am currently using WinForms for Pkcs11Admin , but I plan to use the traditional approach as soon as I get a blocker error on any supported platform.

+5
source

Source: https://habr.com/ru/post/1212882/