Mono: .NET for Linux

Several years ago Microsoft developed a new programming language named C#. To go along with the new language, Microsoft also introduced a new technology termed CLR, Common Language Runtime, which among other features allows programs written in different languages to interact with each other much more easily than was previously possible.

The Linux community faced one small problem with the release of these new technologies: Microsoft only intended to implement each for its own operating systems. Thus, The Mono project ( was founded to implement both the C# programming language and the CLR under Linux. As an aside, Mono now also runs under Windows, making it an alternative to Microsoft's C# implementation.

The Mono project was founded by Miguel de Icaza, best known for his founding contribution to the GNOME desktop environment. de Icaza's company, Ximian (, has contributed most of the resources behind Mono.

Mono consists of three key components:

MCS: the Mono Compile System is responsible for turning C# source code into bytecode and building an executable program.

Mono: the Mono runtime system is responsible for performing Just-In-Time compilation of the bytecode produced by MCS. Mono implements the environment within which your C# programs are run.

A set of Class Libraries: these implement many common features used in many C# programs, such as collection classes, mathematical functions and file I/O.

Mono is still a work in progress, so not all aspects of the C# language and the CLR are properly implemented yet. That doesn't mean Mono is useless, however. Now is a great time to get in early and start playing with the language. In my experience, Mono has successfully compiled and run all of the simple programs I have thrown at it.

If you do happen to find a bug or missing feature in Mono, this is your chance to contribute to the open source community. You can find information on filing bug reports and other ways in which you can contribute to Mono at

Before you fire up your machine to file a report, be sure to take note of other reports to see what makes up a good bug report, and check to see that your bug has not already been spotted by someone else.

Installing Mono

A copy of Mono 0.26 has been included on the cover CD of the PC World November 2003 edition. As a minimum, you must compile and install both mcs-0.26.tar.gz (C# compiler & class libraries) and mono-0.26.tar.gz (CLR). You will need the development tools component of your distribution to be installed to compile Mono.

To compile on most systems, untar each archive and type the following within the directory created by each archive:

$ ./configure --prefix=/usr/local
$ make
$ make install

You will need to be logged in as the super user by using the 'su' command to perform the last command listed above. If Mono compiles properly, it will be installed under /usr/local/. If you try to run Mono and receive a "command not found" error you may need to add /usr/local/bin to your path by typing:

$ export PATH=$PATH:/usr/local/bin Hello World

Here is a quick example of a simple C# program that will work with Mono. The program uses Mono's I/O system to output "Hello World" to the screen.

Each line is numbered to aid readability, so if you type this into your computer, remove the number at the start of each line.

01 using System;
02 class HelloWorld {
03 public static void Main(String[] args) {
04 Console.WriteLine("Hello World");
05 }

Type this program into a text file and save it as "HelloWorld.cs". To compile the program, type:

$ mcs HelloWorld.cs

If the program compiles correctly you will see the message "RESULT: 0". You can now run the program by typing:

$ mono HelloWorld.exe


There is a large effort under way to document all of the classes implemented with Mono. This work-in-progress can be viewed at Currently, most popular classes are very well documented, but there are large gaps in less commonly used areas.

Mono aims to implement the C# language and CLR to the same level as the specification followed by Microsoft, so books and tutorials designed for the Microsoft implementation are equally useful with Mono. Microsoft publishes a lot of helpful information via its developer network Web site at O'Reilly & Associates publishes an extensive collection of articles for all levels covering C# and .NET at

Join the newsletter!


Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Alastair Cousins

PC World
Show Comments

Brand Post

Bitdefender 2019

Taking cybersecurity to the highest level and order now for a special discount on the world’s most awarded and trusted cybersecurity. Be aware without a care!

Most Popular Reviews

Latest Articles


PCW Evaluation Team

Luke Hill


I need power and lots of it. As a Front End Web developer anything less just won’t cut it which is why the MSI GT75 is an outstanding laptop for me. It’s a sleek and futuristic looking, high quality, beast that has a touch of sci-fi flare about it.

Emily Tyson

MSI GE63 Raider

If you’re looking to invest in your next work horse laptop for work or home use, you can’t go wrong with the MSI GE63.

Laura Johnston

MSI GS65 Stealth Thin

If you can afford the price tag, it is well worth the money. It out performs any other laptop I have tried for gaming, and the transportable design and incredible display also make it ideal for work.

Andrew Teoh

Brother MFC-L9570CDW Multifunction Printer

Touch screen visibility and operation was great and easy to navigate. Each menu and sub-menu was in an understandable order and category

Louise Coady

Brother MFC-L9570CDW Multifunction Printer

The printer was convenient, produced clear and vibrant images and was very easy to use

Edwina Hargreaves

WD My Cloud Home

I would recommend this device for families and small businesses who want one safe place to store all their important digital content and a way to easily share it with friends, family, business partners, or customers.

Featured Content

Product Launch Showcase

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?