C# and .NET on Linux

C# on Linux exists for a long time, but many users are unaware of this. The languages that are used most today on Linux are still C, C++ and various scripting languages Python, Perl and Ruby. Miguel de Icaza, the founder of the Gnome Desktop, was the one who aimed to develop an open, crossplatform C# compiler and Common Language Runtime for Linux, Unix and macOS in 2001. The results suceeded in 2004 in the Mono Project1, which is an open implementation of ECMA-334 Standard2 which defines the C# language itself and the ECMA-335 Standard3 which defines a Common Language Infrastructure for different languages, such as C#.

The situation on Linux

You may have used or heard of applications like Banshee music player, F-Spot, a software for organizing photos or Tomboy, a Wiki-like tool for desktop notes. All these applications were developed with Mono and had some remarkable success, but the critics were harsh, Mono at this time somewhat slow and the fear to use something that had to do with Microsoft, the company that has called Linux and the Free Software Movement as “cancer”4, was huge.

14 years later, the IT world has changed. Microsoft is not only a member of the Linux Foundation5 and a sponsor of the Open Source Initiative6, but also open-sourced various of its technologies and tools. The Mono Project still exists and since that time has produced some well known projects like the Unity Game Engine7, MonoDevelop8, an IDE to develop C# applications on Linux and Visual Studio for Mac9. Nevertheless all of the Mono-based Linux applications like Banshee, F-Spot and Tomboy have died or aren’t actively maintained anymore. Unfortunately I’m not aware of a single Linux Desktop application that was made with C# beside MonoDevelop (edit: now I am, the password manager KeePass2 was build with Mono). It seems that the reputation of C# development in the Open Source community is still very bad.

The licensing question

One of the major critics is the fear, that Microsoft could start a lawsuit against the Mono project. Although the .NET Standard is an open ECMA-Standard, Microsoft holds patents for its own .NET implementation, which is the Microsoft .NET Framework. Mono itself is mainly licensed under the MIT license, with parts being licensed under the BSD and the Apache license10. Microsoft has given a Patent Promise11 - not license - that the company will not assert any patents against the project or software written with Mono, as long as the runtime used still implements the full ECMA-335 Standard. And until today Microsoft did not take any legal actions against Mono, but to the surprise of everyone purchased Xamarin Inc.12 in 2016, the company of Miguel de Icaza, which is the main developer of the Mono project. Microsoft even affirmed that they are interested to support and to continue the Open Source .NET implementation13.

In the same year Microsoft released its own open and crossplatform .NET implementation, called .NET Core14. .NET Core runs on Linux, macOS and Windows. .NET Core itself is also licensed under the MIT-License15 with an similar additional “Patent Promise for .NET Libraries and Runtime Components”16. Again Microsoft assures, not to “assert any .NET patents” against developers for “making, using, selling, offering for sale, importing, or distributing Covered Code” as long as the code is part of any compliant .NET runtime implementation (that follows the ECMA-335 standard) or is designed to run on such an implementation. In other words, as long as your code which is using the .NET libraries or code that you modified runs under .NET, .NET Core or Mono, everything is fine. When you try to reimplement patented code on any other runtime (like Java, Ruby etc.) or when you try to strip down a .NET runtime to a subset of the ECMA standard, then you could get in trouble.

Of course this promise is discussed very controversal in the Open Source community. You don’t have the full freedom to do what you want with the software, as you would perhaps expect from a license such as the MIT license. But from my point of view, this is an similar situation with Oracle, which holds patents on parts of the Java language and its JRE/JDK. Even Google owns patents regarding the Go programming language. At least each user has to decide for his self if he/her can live with these restrictions. But as Microsoft is highly interested in attrating developers and - unlike 20 years ago - not a platform but the ecosystem is the most important value of an IT company, it is very unlikely that Microsoft will drop its Open Source initiatives or will chase developers by starting lawsuits.

Do you already use or plan to use C# / .NET Core on Linux?

comments powered by Disqus