That is really unexplained behavior at Microsoft documentations, I wish there is someone from Microsoft in here, to probably suggest a more "official" workaround.
As I believe that's a common issue in Windows 8.1 and Windows 10. Environment.OSVersion Always returns the wrong version number on those two versions.
But anyways here is my suggested "unofficial" solution to it:
Windows Stores the current OS version friendly name in Registry key:
So you can easily read it using regular registry classes and parse it, Something like this should do the trick:
/// Helper method to check if the currently installed OS version name
/// contains the given string
public bool IsCurrentOSContains(string name)
var reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
string productName = (string)reg.GetValue("ProductName");
/// Check if it's Windows 8.1
public void IsWindows8Dot1()
return IsCurrentOSContains("Windows 8.1");
/// Check if it's Windows 10
public void IsWindows10()
return IsCurrentOSContains("Windows 10");
Other than this method i don't know any other method that might work for you.