-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Environment.OSVersion to return actual OS version on Windows #33643
Comments
How do we intend on getting this information? The HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion reg keys? This needs to be coordinated with the Windows team. I don't know about the other keys, but they've said in crystal clear terms that BuildLab and BuildLabEx keys are intended to be human-readable strings used for debugging, and applications should under no circumstance attempt to parse these strings as they're not guaranteed stable across versions. |
|
With the property be quirked to avoid breaking applications expecting the old behaviour? Probably something of a corner case but…? |
Wasn't planning on it. |
It should, though, be documented as a 'breaking-change' for .NET 5. |
Now that dotnet/runtime#34977 and dotnet/runtime#33643 are fixed, Environment.OSVersion returns the correct version for Windows and macOS.
Environment.OSVersion
returns quirked OS version from app manifest on Windows. Consider changing it to return the actual OS version. It's not the recommended solution, but so many times I've seen folks say that Environment.OSVersion is buggy and then go and just do the P/Invoke themselves (or parse some other string-based representation that's doing it).Related:
The text was updated successfully, but these errors were encountered: