Skip to content
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

Windows 10 version being reported as Windows 8 under .NET Core #23

Open
christopher-rtf opened this issue Jul 10, 2020 · 1 comment
Open

Comments

@christopher-rtf
Copy link

Bug
The netstd project for countly-sdk-windows uses Environment.OSVersion to request the version of Windows (instead of System.Management like the .NET Framework SDK uses).

Under some installations of Windows 10, this function returns an OS version which is interpreted as Windows 8:
{Microsoft Windows NT 6.2.9200.0}

Consequently the metrics in Countly all show the OS users as Windows 8 users (even though they are usingWindows 10)

This bug is in ...\Entities\Device.cs's getOSInfo() function. This bug appears to be affecting more than half of our users.

Tested under
Tested under: Windows 10 Pro x64 (May 2020 update), under Parallels

Proposed resolution
As .NET Core now supports System.Management (and since I have confirmed that System Management does return the correct version # under Windows 10 and .NET Core), I recommend that the Countly SDK for Windows add the System.Management nuget package to the netstd project and reuse the pre-existing System.Management query code instead.

Notes from Microsoft on Environment.OSVersion (.NET Core 3.1 docs)
"The Environment.OSVersion property does not provide a reliable way to identify the exact operating system and its version. Therefore, we do not recommend that you use this method."
https://docs.microsoft.com/en-us/dotnet/api/system.environment.osversion?view=netcore-3.1

@ArtursKadikis
Copy link
Member

Hello. I think this could give some insight why the windows 10 version was reported as windows 8:
https://stackoverflow.com/questions/2819934/detect-windows-version-in-net/2819962#2819962

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants