[Mono-list] Running On Platform?
Robert Jordan
robertj at gmx.net
Thu Dec 16 09:29:09 EST 2010
On 16.12.2010 14:14, Andrew Brehm wrote:
>
>
> Robert Jordan wrote:
>>
>> On 15.12.2010 12:17, Lennie De Villiers wrote:
>>> Hi, How can I see on which platform a Mono app is running? Windows,
>>> Linux, Mac OS X?
>>>
>>
>> http://www.mono-project.com/FAQ:_Technical
>>
>> Search for "How to detect the execution platform".
>>
>> Note that Mac OS X cannot be detected this way because it's
>> treated as Unix for compatibility reasons.
>>
>>
>>
>
> Will this ever be changed? Or asked differently, will there ever be an
> actual Mac OS X version of Mono, that includes MonoMac and returns the
> correct platform ID?
I would add an extra "case PlatformID.MacOS" to my detection
code while still handling MacOS in "case PlatformID.Unix".
For the latter I'd use Pinta's IsRunningOnMac():
https://github.com/jpobst/Pinta/blob/master/Pinta.Core/Managers/SystemManager.cs
Robert
More information about the Mono-list
mailing list