Search code examples
c#asp.netmonoxspxsp2

Porting C# Windows GUI to C# web app : how to get it work out-of-the-box for Win, Mac & Linux?


I would like to rewrite an application that currently works as a Windows GUI in C#. The problem is, it works well on Windows, but is not adapted for Mac and Linux because of GUI issues with Mono.

So my idea, was to continue with C# (needed because of an essential sub program that needs to run C# and cannot be ported) and try to rewrite it as a web application that any user on Windows, Mac or Linux could access easily and make it work.

It is also important that my application remains working "out-of-the-box" because it aims high accessibility.

I've looked for solutions like :

  • KayakHTTP but it does not support POST data ! (needed for a web GUI)
  • XSP2 from Mono and make an ASP.NET MVC web app, but will it really work with my web app to make an out-of-the-box application ?

Alternatively, do you have any other idea for me to have a C# web app working out of the box for the end users ? The only thing needed would be to install Mono on Mac and Linux.

Thank you very much for your help.

EDIT 1 : I realize that I have not explained all aspects correctly. In fact, there are 2 applications in my project :

  • The CORE application which is written in C# and is too big to be ported or rewritten and thus must use Mono for running on Mac and Linux
  • My GUI application using Windows Forms which is written in C# too and controls the CORE application

My goal is to convert my GUI application into a web app application so there's no more the Windows Forms GUI hassle on Mac and Linux.


Solution

  • Is it necessary for your core application to run on the client?

    If NOT, then the best approach is to rewrite everything as a web (ASP.NET) application which is going to run on a Windows server. Users on all your target platforms will then access this app through a web browser.

    If YES, then a web app is not a good idea. You really don't want to require a web server on your clients. You have two possibilities:

    • Take a look at the GUI toolkits available for mono and select one that is available on all your target platforms to avoid having different front ends for each of your platforms.
    • To ensure best user experience on all platforms you should choose the native GUI toolkit for each of the platforms and write a different front end for them: either using Mono or using a native development environment as long as your core application has an interface that can be accessed from it (e.g. command line or similar).