[Mono-devel-list] Check whether an app is running on Mono (was Re: [Mono-patches] mcs/class/corlib/Mono ChangeLog,1.1,NONE Runtime.cs,1.2,NONE)

Gonzalo Paniagua Javier gonzalo at ximian.com
Fri May 14 02:40:01 EDT 2004

El vie, 14-05-2004 a las 08:15, Gert Driesen escribió:
> Hi,
> I know of a few open-source projects that used the Mono.Runtime class to
> determine whether their app is running on Mono :
>     // check a class in mscorlib to determine if we're running on Mono
>     if (Type.GetType("Mono.Runtime", false) != null) {
>         // we're on Mono
>         IsMono = true;
>     } else {
>         IsMono = false;
>     }
> Ofcourse I have no problem with this class being removed, but it would be
> good to agree on an another/better way to determine whether an application
> is running on Mono (and not MS.NET), and document this somewhere.  Any
> proposal (eg. use a check for Mono.Math.BigInteger) ?

Ugh, didn't know about that.
What about checking for System.MonoTODOAttribute?


More information about the Mono-devel-list mailing list