Mono

url:http://www.mono-project.com/
docs:http://www.mono-project.com/docs/
api:http://docs.go-mono.com/
tags:programming language, opensource, .net

Mono appeared on 2004 as a crossplatform .NET framework opensource implementation.

Note

This documents covers only C# features of Mono.

Building your sources with the commandline

If your sources have a .csproj/.sln file you can use mdtool to build it, if not you can compile it with Mono C# compiler (mcs).

Using the Mono C# compiler: mcs

url:http://linux.die.net/man/1/mcs

Lets supose you have a single source hello.cs, with the following content:

using System;

class Hello {

    static void Main() {
        Console.WriteLine ("Hello, World!");
    }

}

You can build it running:

mcs example.cs

Using MonoDevelop: mdtool

To obtain mdtool, you will have to install MonoDevolop or Xamarin Studio.

Code analizers

Assembly analizer: gendarme

After running gendarme on our example hello.cs:

mcs hello.cs && mono gendarme.exe hello.exe

We will see a listing with all the defects in our assebly, after fixing them our code will look like:

using System;
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: CLSCompliant (true)]
[assembly: ComVisible (false)]
[assembly: AssemblyVersion ("1.0.0.0")]

static class Hello {

    static void Main() {

        Console.WriteLine ("Hello, World!");

    }
}

Documenting your code

If some one else needs to use your code, you probably should to generate some documentation for your classes, methods one great tool is Doxygen.

UML

Doxygen can generate some basic UML diagrams, if you want the big picture you can try to use NClass

Code coverage

OpenCover

Reports

After running the codecoverage for your tests probably you want to create a report, you can use ReportGenerator

Continuous integration

You can use Jenkins, SonarCube.