开发者

Is Mono really cross-platform?

Official Mono project website says that Mono works successfully on Windows, Linux and Mac OS X. Is that true?

I want to build application开发者_运维问答s which work at least on Windows and Linux. Is it possible with Mono?

P.S. I know that similar topics already exist (e.g. Cross platform .Net?), but they may be outdated.


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.


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.


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.).


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.


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).


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!


Sort of, but not so much. Please note that according to the mono-project site "other" Linux platforms are "unsupported" http://www.mono-project.com/Other_Downloads.

JavaScript and HTML5 is more cross platform than anything else out there. Yes, you can use JavaScript to develop games (Unity3D) and web server apps (Node.js) and mobile apps (Appcelerator, et al)

My best advice is, stop looking for a silver bullet. By the time you find it, it will be something else.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜