How to run C# project under Linux How to run C# project under Linux linux linux

How to run C# project under Linux


You're looking for the Mono Project - a cross-platform (but primarily targeted at Linux) implementation of the .NET Framework and CLR. It's capable of running binaries compiled for the CLR (MS .NET), or of creating its own native Linux binaries.

The project has been going a while now, and it's current version (2.4) is very usable, even for production purposes. See the project roadmap for details of the main features and milestones of current and future releases.

Details about the current state:

The great majority of the BCL (Base Class Library) is available on Mono, with the exception of some of the .NET 3.0/3.5 stuff, such as WPF (which has minimal support currently) and WCF (almost non-existent support). Silverlight 2.0 is however being supported via the Moonlight project, and progress on that is going well. WinForms functionality (which uses GTK# as a backend) is however quite complete, as far as I know.

Implementation of the C# 3.0 language is effectively complete, including the C# 3.0 features such as lambda expressions, LINQ, and automatic properties. I believe the C# compiler is mature to the point that its efficiency is at least comparable with that of the MS compiler, though not yet matching it in some respects. What's quite cool (and unique) about the Mono C# compiler is that is now offers a compiler service - in other words true dynamic compilation from code (without using the CodeDOM). This is something that MS will perhaps only add in .NET 5.0.


Like others have already said, you can run .NET applications on Mono. If your applications use Platform Invocation (P/Invoke) to call native code, you may run into some trouble if there is no Mono implementation of the native library. To check whether your application does that (or uses APIs that haven't been implemented in Mono yet), you can use the Mono Migration Analyzer (MoMA).


For those who come across this question post 2016, can use .NET Core - An open-source, general-purpose development platform maintained by Microsoft and the .NET community on GitHub. It's cross-platform (supporting Windows, macOS, and Linux) and can be used to build device, cloud, and IoT applications.