locked
Determining OS version for Windows 8.1 and Windows 10 RRS feed

  • Question

  • Hi,

    I would like to determine the OS version info (Major, Minor info) using the

    Environment.OSVersion;

    property (my project is targeted for .NETv3.5). However, for both Windows 8.1 and 10, the version returned is the same 6.3. How is this possible? How can 2 different flavors of OS return the same version. Is there any other mechanism by which the exact and the correct version info can be queried in .NET?

    Thanks in advance for your support.

    --Sunil

    Thursday, April 2, 2015 9:41 AM

Answers

  • Finally got this working. Embedding the manifest file & adding Windows 10 to the supportedOS block to the application returns the exact OS version when queried for using

    OperatingSystem osv = Environment.OSVersion;

    For Windows 10 preview version it returns 10.0.

    <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>

    • Proposed as answer by Kristin Xie Wednesday, April 8, 2015 11:05 AM
    • Marked as answer by Kristin Xie Tuesday, April 14, 2015 10:14 AM
    Monday, April 6, 2015 10:41 AM

All replies

  • Win 10 isn't rtm yet so maybe they haven't set the variable.

    Take a look in the registry under:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

    There are several variables might be more reliable.

    eg

    CurrentVersion

    ProductName


    Hope that helps.
    Recent Technet articles: Property List Editing; Dynamic XAML

    Thursday, April 2, 2015 10:53 AM
  • Hi,

    The CurrentVersion in the registry shows '6.3' for both Windows 8.1 and Windows 10 OS. Don't think this is reliable either.

    Friday, April 3, 2015 6:50 AM
  • Hi Sunil PV,

    I don't have Win10 machine. So I cannot test your scenario.

    Just search "Windows 10 OS Version" in the internet.

    http://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions#cite_note-1

    I got NT10 release number.  

    Actually question about Win10 Technical Preview, user can feedback anything via https://insider.windows.com/. but note,win10 is IT preview version not developer preview.   Thanks.

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, April 3, 2015 7:23 AM
  • Hi,

    The CurrentVersion in the registry shows '6.3' for both Windows 8.1 and Windows 10 OS. Don't think this is reliable either.

    Did you look at the other variables?

    Like ProductName?

    I don't have win10 but like I said I know it's not released yet so what you're seeing now could well be different from what happens with the release version.

    Setting version numbers is probably rather lower priority than bug fixes and the like.


    Hope that helps.
    Recent Technet articles: Property List Editing; Dynamic XAML

    Friday, April 3, 2015 9:45 AM
  • Finally got this working. Embedding the manifest file & adding Windows 10 to the supportedOS block to the application returns the exact OS version when queried for using

    OperatingSystem osv = Environment.OSVersion;

    For Windows 10 preview version it returns 10.0.

    <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>

    • Proposed as answer by Kristin Xie Wednesday, April 8, 2015 11:05 AM
    • Marked as answer by Kristin Xie Tuesday, April 14, 2015 10:14 AM
    Monday, April 6, 2015 10:41 AM