Mono and .NET – some things you should be aware of
Mono and .NET – some things you should be aware of
Join the DZone community and get the full member experience.Join For Free
If you ever thought about cross-platform .NET development, then you probably already know about the Mono Framework – a free, open-source, cross-platform implementation of the .NET Framework. It runs on Windows, Linux and Mac. Considering its base structure, Mono is indeed very similar to .NET, however there are some interesting aspects that developers should be aware of when working with the framework instead of .NET. This list is in no way complete; however, I tried to focus on those elements that are often asked about.
This would actually cut the actual cross-platform part from Mono, since WinAPI is platform-specific. Although there is a way to use native libraries in Mono, this should be avoided to the maximum as long as you plan to use the application on multiple platforms. When it comes to Windows-only development, I’d still recommend using the .NET Framework instead of Mono.
Although this shouldn’t be the primary reason for using a specific framework, it is worth mentioning that if you are going to work outside the regular Windows box, chances are you will work with MonoDevelop, once again a free and open-source tool – the official Mono IDE, that, however, doesn’t always has the same capabilities that are present in Visual Studio. In case you are going to work with Mono in Windows, you have the possibility to use MonoTools to work on your Mono projects directly from Visual Studio, but the solution is not free, and once again, chances are you will be using MonoDevelop.
I do indeed encourage people to work as much with a simple text editor and compile manually, but when it comes to large projects, that is not the way to go. Visual Studio has extensive debugging capabilities, team collaboration tools, database tools, testing tools as well as its UI design tools are somewhat better than those in MonoDevelop.
(MonoDevelop v 2.2 running on Ubuntu)
(Visual Studio 2010 running on Windows 7)
When working with user interfaces, don’t expect the UI frameworks to be the same. There is no WPF in Mono (well, even considering its name – Windows Presentation Foundation – there isn’t a similar sub-set of libraries and it is not planned to be present in Mono). There is a somewhat similar to WinForms UI framework – GTK+ that is used in MonoDevelop through GTK#, but its working principles differ from WinForms, so coming from that background will require some additional time learning the particularities of GTK+ UI programming (even with a visual designer present).
No Workflow foundation support in Mono
If you’ve been working with WF (first time released as a part of .NET 3.0), and then decide to migrate to Mono, you will not be able to migrate existing WF solutions simply due to the absence of WF support in Mono. It is planned, however, to add this functionality in one of the next Mono releases.
Mono applications will require Mono Framework
Even considering that Mono is a framework that is based on .NET, when running a Mono application on Windows, don’t expect it to run without the Mono Framework installed, even if you have the latest .NET Framework ready.
This can be considered a drawback, however it makes sense when you take a look at the set of libraries used – Mono pretty much embodies a large number of components that can be used on multiple platforms, therefore it should “adapt” itself to depend as little as possible on a single platform.
Currently, Mono only supports C# and VB.NET development (if talking about .NET-languages) right out of the box. You can add F# support, for example, but that will require some additional configuration. There are a bunch of non-.NET languages supported (for example Java and Lua) that can be integrated with Mono, but those will or won’t be of interest to .NET developers. C++ (CLI) support is not present.
Moonlight is not Silverlight, although close
Moonlight is Novell’s implementation of Microsoft Silverlight that should bring the Silverlight experience to Linux boxes. And although it is in continuous development, it lacks some of the Silverlight functionality (for example, DRM) and falls a bit behind the Silverlight updates. For example, Moonlight 2 is an implementation of Silverlight 2 with some parts of Silverlight 3. The most up-to-date version of Silverlight is version 4.
My conclusion to this article is simple – if you plan to switch to Mono or even work with Mono, even coming with solid .NET knowledge, prepare to change a lot of your development principles and dev tool skills. Mono is implementing pretty much the same functionality that is present in .NET - the current release claims to be the same .NET Framework 3.5 (capability-wise) with some lacking subsets (WPF, WF), however due to its cross-platform nature, many of those libraries will be used somewhat different compared to .NET development.
Opinions expressed by DZone contributors are their own.