In what measure is developing with mono cross-platform? How do I compile for Windows (in Linux), how do I run things in Linux (because there is no .NET JIT compiler)?
So what are the particularities of developing with Mono? What are the advantages over developing with Visual Studio (except cross-platform thinghie)?
Mono is a software platform designed to allow developers to easily create cross platform applications part of the . NET Foundation. Sponsored by Microsoft, Mono is an open source implementation of Microsoft's . NET Framework based on the ECMA standards for C# and the Common Language Runtime.
Mono is a free and open-source . NET Framework-compatible software framework. Originally by Ximian, it was later acquired by Novell, and is now being led by Xamarin, a subsidiary of Microsoft and the . NET Foundation.
NET Core, which natively only allows you to build console apps and web applications, mono allows you to build many application types available in . NET Framework, including GUI-enabled desktop apps. So, if mono can do everything that .
Xamarin is primarily a platform for developing mobile applications (Android and iPhone) using C#. The Mono project is an open-source port of the . NET framework. It is most commonly used to run .
Developing in Mono is definitely cross-platform with a caveat emptor:
#ifdef
out the Windows API and provide your own Mono wrapper in order to minimize code changes, for example, there's a DLL wrapper that uses Interop to invoke a Win32 method such as 'GetFont', this is a hypothetical example, GetFont will return the Font information, under Mono, that does not exist but however you can create a fake wrapper that returns nothing and incorporate the #ifdef
macro to use the wrapper when compiling under Mono, and switch off the macro when compiling under Windows, how you implement the wrapper is up to you.NewLine
to make it independant of Unix's CR and Win32's CRLF, same apply for Path Separator, for Unix '/' and for Win32 '\'.Lastly but not least, keep checking from Mono to Win32 and back again, keep testing and testing it.
Much of the mono runtime is compatible with the CLR, as they follow the same standard.
This means that once you compile your code (in Mono or visual studio), so long as you make sure to only use features supported by both (for example no WMI stuff in mono) and write your application to be platform aware, using best practices (examples are using Path.Combine
to build file and directory paths, using Environment.NewLine
for outputting new lines and more), your application can run unmodified on any platform that has either Mono or the CLR (this includes Windows, Linux and Mac).
You can develop with mono in visual studio, so the part of your question regarding that is moot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With