Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 13345 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
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 188.8.131.52.
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