[Mono-devel-list] Detecting Mono

Gert Driesen gert.driesen at pandora.be
Sun Feb 15 14:23:03 EST 2004


Charlie,

For NAnt we use the following code to detect whether we're running on the
Mono runtime :

if (Type.GetType("Mono.Runtime", false) != null) {
    // we're on Mono
    IsMono = true;
} else {
    IsMono = false;
}

Hope this helps,

Gert

----- Original Message ----- 
From: "Charlie Poole" <cpoole at pooleconsulting.com>
To: <mono-devel-list at lists.ximian.com>
Sent: Sunday, February 15, 2004 8:02 PM
Subject: [Mono-devel-list] Detecting Mono


> Hi All,
>
> I'm working under Windows to develop the next release of NUnit, and I'm
> testing under Mono as well as MS .NET.
>
> In order to be sure I'm running under mono in a particlular test
execution,
> I'm using
> typeof( System.Object  ).Assembly.CodeBase and looking for "Mono" in the
> path.
>
> This is pretty kludgy and only of course depends on the location in which
> I've installed Mono.
>
> Any better suggestions?
>
> Charlie Poole
> cpoole at pooleconsulting.org
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>




More information about the Mono-devel-list mailing list