Kornél,

isMono =
  (int)Environment.OSVersion.Platform == 128 ||  // Fw 1.1
  (int)Environment.OSVersion.Platform == 4;      // Fw 2.0

I don't know how DotGNU can be detected.


Thanks, but this not what I want to detect. This detects the Operating
System.
But I want to detect the type of CLI (.NET Framework/Mono/Portable.NET)

There is no "official" way to detect the CLRs.

You may try to instantiate a type that only exists
on Mono (i.e. one from the Mono.* namespaces). However, most
of those types might run with MSFT runtime as well ...

I've already seen such code in one of Mono's test cases,
but I cannot recall where.

Another way might be to call some unimplemented
System.Runtime.InteropServices.Marshal methods.
That's what I'm doing.

Rob

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to