You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 28, 2020. It is now read-only.
Environment.OSVersion has issues, for starters it doesn't return a sensible value for macOS:
// Output://// macOS 10.12.6 (16G29) --> Hello from Unix (Unix 16.7.0.0)// Ubuntu 16.04.3 LTS --> Hello from Unix (Unix 4.4.0.43)// Windows 1709 (16299.19) --> Hello from Win32NT (Microsoft Windows NT 6.2.9200.0)
Console.WriteLine($"Hello from {Environment.OSVersion.Platform} ({Environment.OSVersion})");
But as per @weshaggard there are other issues such as:
People checking for exact enum values for PlatformId. That break things for Unix vs Linux vs OSX which value should I check for? I think our existing IsOSPlatform allows for better checking
Also the enum value for the platform checks is nearly impossible to update in all our platforms as we add new ones. This is why OSPlatform can be default to a string until we can make the constant available in all our platforms.
We cannot actually make the enum value different without breaking compat so things like OSX will never be returned as a platform as an example.
Too much code does exact version checks instead of IsAtLeast this version type of check. We have yet to solve this.
OS’s like windows start to lie about the OSVersion because of people doing exact version checks so then folks really don’t have a value to query. We can help with this with better version check APIs.
We want to help folks find other ways to solve the scenarios they would use version for (i.e. feature light-up) to help eliminate some of the need to do version checks at all.
The text was updated successfully, but these errors were encountered:
Environment.OSVersion
has issues, for starters it doesn't return a sensible value for macOS:But as per @weshaggard there are other issues such as:
The text was updated successfully, but these errors were encountered: