If anybody having the solution of advantages and limitations开发者_运维知识库 of using mono project to run C# Code on Linux, Please tell me your thoughts...
There's a huge advantage - it works. You can use C#, develop, and run on Linux (and other platforms, including Windows).
The disadvantage is that things don't always work the same way as they do in MS's .NET implementation, and there is some functionality that is not implemented at all, such as WPF.
Advantages
- Investment - when you choose right software you don't have to pay for software licences when running Mono on Linux (this doesn't mean that it's free - Linux is only free if your time has no value).
- No vendor lock-in - you have more choices for other software on Linux (for example DB or Web servers) when compared to MS solutions which works best with other MS stuff.
- Mono specific libraries (for example Mono.Simd or REPL).
- Open source (you, or others, can fix bugs/provide patches/improve code by yourself).
Limitations
- Incompatibility with MS.NET framework.
- In general you will probably spent more time with certain things (for example dealing with incompatibility or learning Linux administration and such).
- Mono is not up-to-date with new API and features for some time when new version of .NET framework is released.
I have developed a few apps in C# and have tried to get a few running on Linux via Mono. Getting console applications to run in pretty simple. Most of the time, there is no code change needed to get these types of applications running under Mono. However, GUI applications are always more tricky. The first thing you should know is that your user interface will not blend in with the user's theme. The application will always look like a Windows 98 application, assuming you are using Microsoft's System.Windows.Forms.
If, however, you plan to write and run the application only on Linux, then you could use Mono's Gtk# to build the user interface. This integrates with Linux desktops much better than System.Windows.Forms. This page gives a good rundown of the different GUI toolkits, their pros, and their cons.
If you are sticking with System.Windows.Forms for the GUI toolkit in order to run your application on both Windows and Linux, keep in mind that even though Mono supports C# 4.0, you are better off keeping yourself limited to C# 2.0, as some of the features of 3.0 and up aren't implemented or do not work well on Linux.
精彩评论