views:

448

answers:

6

Official Mono project website says that Mono works successfully on Windows, Linux and Mac OS X. Is that true?
I want to build applications which work at least on Windows and Linux. Is it possible with Mono?

P.S. I know that similar topics already exist (e.g. http://stackoverflow.com/questions/56013/cross-platform-net), but they may be outdated.

+3  A: 

It sure is. Mono will work across all three platforms, but when you say "building an application" you need to be aware that not all the .net namespaces have been ported across to Mono. They have placed a heavy focus on porting the "web bits" across so you shouldn't have too much trouble writing a web application that will work cross platform, but if you're looking to write a client application, you might need to check out the moonlight project which is a silverlight implementation for Linux.

lomaxx
I'm not sure the OP is talking about Silverlight/Moonlight/Web applications, but desktop applications. Desktop applications should easy to do cross-platform. "building an application" does not necessarily mean Silverlight/Moonlight/WPF, but can also be classic Forms.
Thorsten Dittmar
Excuse me, but what does Silverlight has to do with client applications? I thought this was somekind of Flash-Clone? Also, the System.Windows.Forms Namespace is completely ported, and there are also the GTK# Bindings since a long time.
Bobby
I completely agree, what I was getting at was that you can't just expect a WPF application to work on Linux, and even within the forms space there are some quirks between the Win32API bindings in .net and the GDK# binding on Linux, whereas these problems don't tend to exist so much in a web app.
lomaxx
Well, Sergey was talking about Mono Applications...so I think he wants to use also Mono on Windows, and not switching between Mono and .NET depending on the platform. And within Mono there shouldn't be any platform-specific...arrr...needs?
Bobby
@BobbySilverlight has similarities to Flash but is much more targeted at producing line-of-business applications. It is entirely feasible to produce client desktop applications in Silverlight with version 3.
Alan B
+2  A: 

I haven't done much in Mono yet, but it works really well. I'd suggest you develop under Linux. Then you can be very sure it works on Windows too (as long as you don't do stupid things like hardcoding paths, etc.).

Thorsten Dittmar
You haven't done much but it works really good for the very few things you've done? How is that useful?
_NT
In that it shows that even though I've not developed a mega-project I felt "home" in Mono instantly. I didn't say anything like "I've never seen it, but yes, it's 100% compatible" - so if not much, there's at least little value in my reply.
Thorsten Dittmar
+6  A: 

Yes it is possible.

It generally works quite well, but I don't think there are any large/medium scale applications on Mono. There are several other apps you may want to have a browse through.

As Mono is a subset of the real thing (.NET), to maintain the best compatibility, you may have to develop in a Mono supported platform (e.g. Linux), then once it works there you can pretty much be certain that it will work on .NET. I'm saying this because although highly compatible with .NET, Mono is not as many people think fully compatible with the entire .NET stack and has other limitations too.

I have done development on it and stumbled across several of those. I hope your project does not have as many .NET dependencies as mine.

_NT
Yes, there are serious applications that are written using Mono. A number of the programs that you get with the GNOME desktop are writting using Mono.
Jesper
Monodevelop (IDE) is fairly large, and runs on Windows, Mac, and Linux. And, as I understand, they're working on getting Banshee (Media Player) to run on Windows.
sgwill
How are Second Life scripting language or Wikipedia search implementation not large scale applications? Yes, they do run on Mono.
skolima
+1  A: 

It is cross-platform, just don't make the mistake of developing on Windows and using .NET libraries that are not implemented in Mono. For example Mono doesn't support WebParts even though .NET does.

Gergely Orosz
A: 

Yes.

Of course it depends on what you are developing, and how you develop and test it. It may sound obvious, but any multi-platform app needs to be tested on each platform you need to support.

FWIW I created a NAnt-based Subversion admin tool that runs on Linux and Windows using Mono or Microsoft.NET interchangeably. Although I use it mainly on Windows, it works just as well on Linux.

You do also have to pay more attention to the finer details, like always using Environment.NewLine and Path.Combine, but that's a good thing!

Si
+1  A: 

Mono works very well for creating WinForms applications that work on Windows and Linux. You can also use GTK if you prefer (broadly speaking I find WinForm UI's look slightly better under Windows, GTK interfaces look slightly better under Linux though depending on your app there may be little to know difference).

The Web Services implementation is also excellent (better than Microsoft's implementation in IIS, in fact) and works cross platform on both Windows, Linux and Mac OS.

However, if this is the road you want to go down you will have to build your project with Mono in mind. .NET projects created in Visual Studio will likely not run under Mono without (possibly significant) modification as not all .NET libraries are implemented - however Mono code will work just fine in Visual Studio (assuming they don't invoke any Mono specific libraries - but it's clear when your doing that as they are in the Mono.* namespace.).

Mono command line applications work just fine in Mac OS too, but the WinForms implementation on Mac OS is limited so if Mac OS is a consideration you are better off creating a native GUI in XCode and wiring it up to a C# backend as (unlike on Windows and Linux) Mono's WinForms implementation on Mac OS is not production quality.

I strongly recommend you check out Delphi Prism if you you are interested in creating cross platform (Win/Linux/Mac OS) apps in Visual Studio. There are other options (MonoDevelop IDE, Eclipse, TextMate) but it's easy to get to grips with, although not free.

Note: Contrary to what the name may suggest Delphi Prism allows you to write Mono apps in C#, not just using Delphi. It also makes wiring up Mono apps to Mac OS GUI's easier, but porting to Mac OS still requires a fair bit of extra effort (but not nearly as much as porting to ObjC!).

Lastly, this is isn't what you asked, but may be of interested to you: You could also consider using something like REALBasic to create the GUI and invoke bundled apps in Mono in the background (depending on what sort of app you are working on, and if you can't stomach using Basic in RB).

Iain Collins