System.Environment.OSVersion Property

Gets an OperatingSystem object that contains the current platform identifier and version number.


public static OperatingSystem OSVersion { get; }


A OperatingSystem object representing the current platform.


Typically, the Environment.OSVersion property is used to ensure that an app is running on some base version of an operating system in which a particular feature was introduced. When this is the case, you should perform a version check by testing whether the current operating system version returned by the Environment.OSVersion property is the same as, or greater than, the base operating system version. For more information, see the Version class topic.

The Environment.OSVersion property returns the version reported by the Windows tp:// function.


The Environment.OSVersion property reports the same version number ( for both win8 and win81.

In some cases, the Environment.OSVersion property may not return the operating system version that matches the version specified for the Windows Program Compatibility mode feature.


Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0,,