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

vladimir at pobox.com vladimir at pobox.com
Fri May 14 03:25:53 EDT 2004


Hi,

I've been using System.Environment.OSVersion.Platform for this, e.g.:

if (Environment.OSVersion.Platform == (PlatformID) 128) {
	/* Unix, persumably Mono */
} else {
	/* MS-land, can check for specific PlatformIDs */
}

The 128 has to be used as an integer and cast, because using a "new"
enum value here would break source and binary compatability.

	- Vlad




More information about the Mono-devel-list mailing list