This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the current platform identifier and version number.
public: static property OperatingSystem ^ OSVersion { OperatingSystem ^ get(); };public static OperatingSystem OSVersion { get; }static member OSVersion : OperatingSystemPublic Shared ReadOnly Property OSVersion As OperatingSystemThe platform identifier and version number.
This property was unable to obtain the system version.
-or-
The obtained platform identifier is not a member ofPlatformID
Environment.OSVersion returns an OS version that may be incorrect when an application runs under Windows compatibility mode. For more information, seeGetVersionExA function remarks.
In .NET 5 and later versions,Environment.OSVersion returns the actual OS version in compatibility modes specified by theapplication manifest. For more information, seeEnvironment.OSVersion returns the correct operating system version.
To identify the operating system platform, for example, Linux or Windows, you can use theRuntimeInformation.IsOSPlatform method.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?