Federal09
Federal09

Reputation: 649

Why OS.Version reports Windows 8.0 for Windows 8.1?

When use Environment.OSVersion.Version.ToString(); on this mode

MessageBox.Show(Environment.OSVersion.Version.ToString()); show the value 6.2 when use ver command on CMD return 6.3

I have Windows 8.1 Professional Edition Original

like this (the messageBox is a RadMessageBox from Telerik Controls): enter image description here

Why?

Upvotes: 0

Views: 2200

Answers (4)

Federal09
Federal09

Reputation: 649

I have used this method!

RegistryKey key2 = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, "");
                RegistryKey subkey2 = key2.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion");
                string value = subkey2.GetValue("CurrentVersion").ToString();
                if (value == "6.3")

Upvotes: -1

Softwarehuset
Softwarehuset

Reputation: 815

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx

If you look here you find that it depends on the manifest of your application. Look at the star point :)

Upvotes: 4

Jimmy
Jimmy

Reputation: 28406

This is a feature, not a bug. It is because Windows 8.1 will only report the version as 6.3 to applications which have been specifically targeted to that platform.

See here and here for official documentation.

Upvotes: 7

Joachim Isaksson
Joachim Isaksson

Reputation: 180987

From the manual;

The OSVersion property reports the same version number (6.2.0.0) for both Windows 8 and Windows 8.1.

In other words, a documented "limitation".

Upvotes: 6

Related Questions