Getting Started With Mono

[mono logo]

Mono has just hit 1.0. It is now time for me to abandon Java and start developing in c# instead. Let's get started:

## Lines added to /etc/yum.conf
## visit http://www.mono-project.com/downloads/
## for the correct url for your distro and version.
[ximian-mono]
name=Ximian Mono
baseurl=http://mono2.ximian.com/archive/1.0/fedora-2-i386/

After updating /etc/yum.conf, I installed everything mono, willy-nilly.

$ sudo yum install mono*

Now we play with mcs, the mono compiler. Here is Hello World:

/* ~/code/c-sharp/Hello.cs */
/**
   Hello World in C Sharp
**/
using System;
class  Hello {
    static void Main() {
	Console.Write("hello world\n");
    }
}
/*EOF*/

Compile and and run:

$ mcs Hello.cs
Compilation succeeded
$ ls
Hello.cs  Hello.exe
$ mono Hello.exe
hello world
$

Yea!

$ monodoc &