System.Environment.OSVersion.Platform == System.PlatformID.Unix on Mac OSX as well as the OS version that's reported is the BSD kernel version, not the Mac OSX version.
PlatformID.Unix is reported on Mac OS X because it broke too much stuff when it returned PlatformID.MacOSX:
See also the "How to detect the execution platform ?" section at: http://mono-project.com/FAQ%3a_Technical#Mono_Platforms
> Notice that as of Mono 2.2 the version returned on MacOS X is still 4 for legacy reasons,
> too much code was written between the time that the MacOSX value was introduced and
> the time that we wrote this text which has lead to a lot of user code in the wild to not
> cope with the newly introduced value.
> the OS version that's reported is the BSD kernel version, not the Mac OSX version.
I don't understand what you're asking with this; do you want Environment.OSVersion.Version to return the BSD kernel version, or the Mac OS X version?
To me, returning the BSD kernel version makes no sense; why would I care?
Returning the Mac OS X version makes considerably more sense, and is what is currently returned:
> $ uname -a
> Darwin penpen.home 12.4.1 Darwin Kernel Version 12.4.1: Tue May 21 17:04:50 PDT 2013; root:xnu-2050.40.51~1/RELEASE_X86_64 x86_64
> $ echo Environment.OSVersion.Version | csharp
The versions match; 12.4.1 is 184.108.40.206.
I concede on the PlatformID and that does make sense.
What I want is the OS version. I did misspeak in that its the Darwin Kernel that's reported not OSX. I would expect something more like 10.8.x.
So you want Environment.OSVersion.Version to print `sw_vers | grep ProductVersion`:
ProductName: Mac OS X
or `system_profiler SPSoftwareDataType`.
(Both commands from: http://hintsforums.macworld.com/archive/index.php/t-60607.html )
Yes please :)
+1 on this change.
On windows, this property reports the system version and not the "marketing" version because, well, that's what .net reports, and users know how to map those values to what they need to know (if they're running on xp, vista, 7, whatever), and mono follows the 99% compatibility rule there ;)
On OSX this relation is not a known quantity for users (who the heck knows which kernel versions map to the OS version or when they change?), and what the user needs to know is the version of the OS they're running on so they can make decisions on system behaviour, and this information is publicly available for the "marketing" version of OSX.
</my 2 cents>
Environment.OSVersion.Version on macOS should print macOS version not Darwin release version