Untuk compile kod C#, gunakan mcs dari pakej mono-mcs
Katakan kod sumber adalah kod.cs dengan kandungan seperti berikut
[code lang=’csharp’]using System;
class Hello {
static void Main() {
Console.WriteLine (“Hello, World!”);
}
}
[/code]
Compile kod seperti berikut:
mcs kod.cs
Fail executable/essembly bernama kod.exe akan terhasil. Untuk uji essembly tersebut:
./kod.exe