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 PC World newsletter!

Error: Please check your email address.

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Alastair Cousins

PC World
Show Comments

Most Popular Reviews

Best Deals on PC World

Latest News Articles


GGG Evaluation Team

Kathy Cassidy


First impression on unpacking the Q702 test unit was the solid feel and clean, minimalist styling.

Anthony Grifoni


For work use, Microsoft Word and Excel programs pre-installed on the device are adequate for preparing short documents.

Steph Mundell


The Fujitsu LifeBook UH574 allowed for great mobility without being obnoxiously heavy or clunky. Its twelve hours of battery life did not disappoint.

Andrew Mitsi


The screen was particularly good. It is bright and visible from most angles, however heat is an issue, particularly around the Windows button on the front, and on the back where the battery housing is located.

Simon Harriott


My first impression after unboxing the Q702 is that it is a nice looking unit. Styling is somewhat minimalist but very effective. The tablet part, once detached, has a nice weight, and no buttons or switches are located in awkward or intrusive positions.

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?