Take the 2-minute tour ×

Let's say just for the joy of it, I decide that I don't want to write desktop applications in Java any more, instead want to switch to using C#. I want to be able to build an application that will run on some mainstream Linux distribution, and a recent release of MS Windows. It will have a GUI component.

In Java I can build an application that uses Swing. Once I have it working, I can copy that jar file from Windows to Linux or vice versa, depending where I developed it. And it will generally run with java -jar myapp.jar.

In C# is it possible to do this? Is there a functional equivalent to Swing or AWT in C#?

share|improve this question
You can try NOV: nevron.com/products-open-vision.aspx. It is functionally equivalent to Swing –  Ivo Milanov Jul 3 at 12:37

10 Answers 10

Probably GTK# would be the closest.

I know others have said mono, but that's not quite right. .Net is to mono as Microsoft's Java VM is to Sun's Java runtime. mono's not really in the same conceptual space as Swing. For that, GTK# is a closer match.

share|improve this answer
I know what you're saying, in his question he asked about AWT or Swing - but what I think he's really asking is "how can I write cross-platform C# apps?". –  Sam Schutte Apr 23 '09 at 13:31

There's Eto.Forms (on github), which is an abstraction layer on top of WPF, WinForms, GTK, and MonoMac/Cocoa - so you can get a native UI on all platforms without having to re-implement for each platform. You don't have to suffer from lowest common denominator, since you can implement specifics for each platform (if desired, but not required).

It has an advantage that it is pure .NET and only relies on OS-supplied dependencies, as opposed to using GTK or WxWidgets where you'd have to bundle the native binaries for various platforms.

share|improve this answer
Hello! Can I use Eto.Forms with Gtk# on Windows? Thanks! –  user2656632 Nov 3 at 23:53
@user2656632 yes, you certainly can. Just pass the appropriate platform to the Eto.Forms.Application constructor. (; –  Curtis Nov 5 at 20:30

I believe a good portion of WinForms is implemented in Mono. You need to install Mono under Linux for that. You may have compatibility problems, though, since Mono is not a Microsoft effort and is not officially supported by them.

share|improve this answer
Yes, but it is a very good community effort, and I've only seen compatibility problems when I was doing something completely ridiculous (comments are too short to describe :D). Normal desktop programming is usually just fine. –  Lucas Jones Apr 22 '09 at 21:25
@person-b, I agree, it is a very good community effort :-) –  unforgiven3 Apr 22 '09 at 21:26
As far as i am aware all of WinForms 2.0 is implemented. –  Gary Willoughby Apr 22 '09 at 21:28
WinForms really? That's interesting. When last I checked a few years ago, there was nothing. –  Jay R. Apr 22 '09 at 21:29
@Jay: key phrase there is "a few years ago" mono is still a very active project. –  Joel Coehoorn Apr 22 '09 at 21:31

This page has a list of the GUI toolkits supported by Mono, including pros and cons for each of them. As others have suggested, WinForms, GTK#, and wxNet are all viable options.

share|improve this answer

The closest thing I've ever seen is Mono - though it doesn't support all the CLR libraries yet I believe, but it is cross-platform.

share|improve this answer

You can try WxWidgets. It has support for C#, among many other languages, and is cross-platform. The only downside being a recompile for each platform. Alternatively you can try Mono which is very good, but beware there are a couple snags with compatibility issues. There is no predefined "run anywhere" file for C# apps yet like Java has with jars though, you're best bet is to recompile for each platform if you want to ensure compatibility.

share|improve this answer

For iOS, Android, and Windows Mobile, there is Xamarin.Forms. http://xamarin.com/forms This is an abstraction layer that allows you to write cross-platform code, which binds to the native GUI toolkits under the hood.

I am looking for more solutions like this - I care not only about mobile platforms, but also desktop platforms (windows, mac OSX, fedora/ubuntu/etc linux)

share|improve this answer

This is an older question, but as an update, a combination of Mono and Xamarin should work for your modern cross-platform needs.


Microsoft has just open-sourced .NET and is committing to bringing the .NET core to Linux and MacOS with their next version. Microsoft has also formed a close partnership with Mono and Xamarin, specifically to help with their Android and Linux libraries.


share|improve this answer

There finally is a cross platform .NET UI, that you can use to develop your application on Mac or Windows. Once you've built it, you simply need to recompile on the platform you wish your application to work on. Unfortunately it doesn't support Linux, but it does support Windows, WinForms, WPF, Silverlight, Mac OS X.

share|improve this answer

Windows.Forms is the standard library for developing GUI applications for .NET

Despite of being very well supported on Windows, version 2.0 is fully implemented by Mono too, which makes it available on all platforms supported by Mono.

WPF on the other hand is is conceptually new library, for now it is fully supported mainly on Windows only and just a subset of it supported by Mono by their Silverlight implementation - Moonlight.

If you are building application for productive cross-platform use and/or have conservative performance constraints go Windows Forms.

If you want to experiment and learn something new or if you are developing new application for Windows go WPF. This is the new technology for client GUI applications.

share|improve this answer
Mono cannot run Windows.Forms on Linus or Mac since Windows.Forms depends on Win32 API calls. –  Ivan Nikitin Oct 17 '12 at 5:51

Your Answer


