[Mono-devel-list] Platform identification

Miguel de Icaza miguel at ximian.com
Fri Nov 21 15:06:54 EST 2003


Hello,

> With a recent update of Mono I've run into a problem with platform 
> identification. My code relied upon PlatformID.Unix for this
> puporse. Now PlatformID.Unix no longer exists so my code no longer
> works. Actually my method of platform identification has always
> been a kludge so I don't complain about it. But if I start using
> another kludge that works now I'm not sure how much time it will
> stay working. I don't want to deal with this problem over and over
> again.
> 
> So could we introduce an official method of platform identification
> that will remain working and supported all the time?


Well, the issue is that we can not introduce public methods, variables
or definitions which are not part of the .NET Framework.  I have asked
everyone I have ran into to get a value allocated for Unix.  But even if
we get the value in .NET 1.2, it would not work for the .NET 1.1
profile.

The current hack is to obtain the PlatformID, and cast that to an int. 
If the value returned is 128, then you know this is Unix.

Sorry for the pain.

Miguel



More information about the Mono-devel-list mailing list