mscorlib
1.0.5000.0
2.0.0.0
2.0.5.0
4.0.0.0
netstandard
2.0.0.0
2.1.0.0
System.Runtime.Extensions
4.2.0.0
4.2.1.0
4.2.2.0
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
System.Object
System.ICloneable
System.Runtime.Serialization.ISerializable
[System.Runtime.CompilerServices.Nullable(0)]
[<System.Runtime.CompilerServices.Nullable(0)>]
[System.Serializable]
[<System.Serializable>]
[System.Runtime.InteropServices.ComVisible(true)]
[<System.Runtime.InteropServices.ComVisible(true)>]
Represents information about an operating system, such as the version and platform identifier. This class cannot be inherited.
class contains information about an operating system.
For information about the current runtime operating system, retrieve the object returned by the property. For a list of Windows operating system versions and their corresponding version numbers returned by the and properties and the method, see [Operating System Version](/windows/win32/sysinfo/operating-system-version).
By design, the class is not a general purpose means of describing an operating system, and you cannot derive a more inclusive type from the class. If you need a type to contain other information about an operating system, create your own type, then include a field of type and any additional fields, properties, or methods that you require.
## Examples
The following code example uses the object to display information about the runtime operating system.
:::code language="csharp" source="~/snippets/csharp/System/OperatingSystem/Overview/osinfo1.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System/OperatingSystem/Overview/osinfo1.fs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System/OperatingSystem/Overview/osinfo1.vb" id="Snippet1":::
]]>
Constructor
mscorlib
1.0.5000.0
2.0.0.0
2.0.5.0
4.0.0.0
netstandard
2.0.0.0
2.1.0.0
System.Runtime.Extensions
4.2.0.0
4.2.1.0
4.2.2.0
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
One of the values that indicates the operating system platform.
A object that indicates the version of the operating system.
Initializes a new instance of the class, using the specified platform identifier value and version object.
To be added.
is .
is not a enumeration value.
If you are using the class to retrieve information about the runtime operating system, you should not call this constructor to instantiate an object. Instead, you can retrieve an object that describes the operating system from the property.
Method
M:System.ICloneable.Clone
mscorlib
1.0.5000.0
2.0.0.0
2.0.5.0
4.0.0.0
netstandard
2.0.0.0
2.1.0.0
System.Runtime.Extensions
4.2.0.0
4.2.1.0
4.2.2.0
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
System.Object
Creates an object that is identical to this instance.
An object that is a copy of this instance.
method to make a copy of an object. The clone is compared with the original object to show that they are not the same object.
:::code language="csharp" source="~/snippets/csharp/System/OperatingSystem/Clone/clone.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System/OperatingSystem/Clone/clone.fs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System/OperatingSystem/Clone/clone.vb" id="Snippet1":::
]]>
Method
M:System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)
mscorlib
2.0.0.0
2.0.5.0
4.0.0.0
netstandard
2.0.0.0
2.1.0.0
System.Runtime.Extensions
4.2.0.0
4.2.1.0
4.2.2.0
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
[System.Security.SecurityCritical]
[<System.Security.SecurityCritical>]
System.Void
The object to populate with serialization information.
The place to store and retrieve serialized data. Reserved for future use.
Populates a object with the data necessary to deserialize this instance.
method.
For more information, see the method.
]]>
is .
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
Indicates whether the current application is running on Android.
if the current application is running on Android; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
The major release number.
The minor release number.
The build release number.
The revision release number.
Checks if the Android version (returned by the Linux command uname) is greater than or equal to the specified version. This method can be used to guard APIs that were added in the specified version.
if the current application is running on an Android version that is at least what was specified in the parameters; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
Indicates whether the current application is running as WASM in a browser.
if the current application is running as WASM in a browser; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
Indicates whether the current application is running on FreeBSD.
if the current application is running on FreeBSD; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
The major release number.
The minor release number.
The build release number.
The revision release number.
Checks if the FreeBSD version (returned by the Linux command uname) is greater than or equal to the specified version. This method can be used to guard APIs that were added in the specified version.
if the current application is running on a FreeBSD version that is at least what was specified in the parameters; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
[System.Runtime.Versioning.SupportedOSPlatformGuard("maccatalyst")]
[<System.Runtime.Versioning.SupportedOSPlatformGuard("maccatalyst")>]
System.Boolean
Indicates whether the current application is running on iOS or MacCatalyst.
if the current application is running on iOS or MacCatalyst; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
[System.Runtime.Versioning.SupportedOSPlatformGuard("maccatalyst")]
[<System.Runtime.Versioning.SupportedOSPlatformGuard("maccatalyst")>]
System.Boolean
The major release number.
The minor release number.
The build release number.
Checks if the iOS/MacCatalyst version (returned by libobjc.get_operatingSystemVersion) is greater than or equal to the specified version. This method can be used to guard APIs that were added in the specified iOS version.
if the current application is running on an iOS/MacCatalyst version that is at least what was specified in the parameters; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
Indicates whether the current application is running on Linux.
if the current application is running on Linux; otherwise.
To be added.
Method
System.Runtime
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
Indicates whether the current application is running on Mac Catalyst.
if the current application is running on Mac Catalyst; otherwise.
To be added.
Method
System.Runtime
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
The version major number.
The version minor number.
The version build number.
Check for the Mac Catalyst version (iOS version as presented in Apple documentation) with a ≤ version comparison. Used to guard APIs that were added in the given Mac Catalyst release.
if the Mac Catalyst version is greater or equal than the specified version comparison; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
Indicates whether the current application is running on macOS.
if the current application is running on macOS; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
The major release number.
The minor release number.
The build release number.
Checks if the macOS version (returned by libobjc.get_operatingSystemVersion) is greater than or equal to the specified version. This method can be used to guard APIs that were added in the specified macOS version.
if the current application is running on an macOS version that is at least what was specified in the parameters; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
The case-insensitive platform name. Examples: Browser, Linux, FreeBSD, Android, iOS, macOS, tvOS, watchOS, Windows.
Indicates whether the current application is running on the specified platform.
if the current application is running on the specified platform; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
The case-insensitive platform name. Examples: Browser, Linux, FreeBSD, Android, iOS, macOS, tvOS, watchOS, Windows.
The major release number.
The minor release number (optional).
The build release number (optional).
The revision release number (optional).
Checks if the operating system version is greater than or equal to the specified platform version. This method can be used to guard APIs that were added in the specified OS version.
if the current application is running on the specified platform and is at least in the version specified in the parameters; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
Indicates whether the current application is running on tvOS.
if the current application is running on tvOS; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
The major release number.
The minor release number.
The build release number.
Checks if the tvOS version (returned by libobjc.get_operatingSystemVersion) is greater than or equal to the specified version. This method can be used to guard APIs that were added in the specified tvOS version.
if the current application is running on a tvOS version that is at least what was specified in the parameters; otherwise.
To be added.
Method
System.Runtime
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
Indicates whether the current application is running as WASI.
To be added.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
Indicates whether the current application is running on watchOS.
if the current application is running on watchOS; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
The major release number.
The minor release number.
The build release number.
Checks if the watchOS version (returned by libobjc.get_operatingSystemVersion) is greater than or equal to the specified version. This method can be used to guard APIs that were added in the specified watchOS version.
if the current application is running on a watchOS version that is at least what was specified in the parameters; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
Indicates whether the current application is running on Windows.
if the current application is running on Windows; otherwise.
To be added.
Method
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
netstandard
System.Runtime.Extensions
System.Boolean
The major release number.
The minor release number.
The build release number.
The revision release number.
Checks if the Windows version (returned by RtlGetVersion) is greater than or equal to the specified version. This method can be used to guard APIs that were added in the specified Windows version.
if the current application is running on a Windows version that is at least what was specified in the parameters; otherwise.
To be added.
Property
mscorlib
1.0.5000.0
2.0.0.0
2.0.5.0
4.0.0.0
netstandard
2.0.0.0
2.1.0.0
System.Runtime.Extensions
4.2.0.0
4.2.1.0
4.2.2.0
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
System.PlatformID
Gets a enumeration value that identifies the operating system platform.
One of the values.
objects and displays the property for each.
:::code language="csharp" source="~/snippets/csharp/System/OperatingSystem/Platform/plat_ver.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System/OperatingSystem/Platform/plat_ver.fs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System/OperatingSystem/Platform/plat_ver.vb" id="Snippet1":::
]]>
Property
mscorlib
2.0.0.0
2.0.5.0
4.0.0.0
netstandard
2.0.0.0
2.1.0.0
System.Runtime.Extensions
4.2.0.0
4.2.1.0
4.2.2.0
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
System.String
Gets the service pack version represented by this object.
The service pack version, if service packs are supported and at least one is installed; otherwise, an empty string ("").
property.
:::code language="csharp" source="~/snippets/csharp/System/OperatingSystem/ServicePack/sp.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System/OperatingSystem/ServicePack/sp.fs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System/OperatingSystem/ServicePack/sp.vb" id="Snippet1":::
]]>
Method
mscorlib
1.0.5000.0
2.0.0.0
2.0.5.0
4.0.0.0
netstandard
2.0.0.0
2.1.0.0
System.Runtime.Extensions
4.2.0.0
4.2.1.0
4.2.2.0
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
System.String
Converts the value of this object to its equivalent string representation.
The string representation of the values returned by the , , and properties.
method to display objects.
:::code language="csharp" source="~/snippets/csharp/System/OperatingSystem/ToString/ctor_tostr.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System/OperatingSystem/ToString/ctor_tostr.fs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System/OperatingSystem/ToString/ctor_tostr.vb" id="Snippet1":::
]]>
Property
mscorlib
1.0.5000.0
2.0.0.0
2.0.5.0
4.0.0.0
netstandard
2.0.0.0
2.1.0.0
System.Runtime.Extensions
4.2.0.0
4.2.1.0
4.2.2.0
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
System.Version
Gets a object that identifies the operating system.
A object that describes the major version, minor version, build, and revision numbers for the operating system.
objects and displays the property for each.
:::code language="csharp" source="~/snippets/csharp/System/OperatingSystem/Platform/plat_ver.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System/OperatingSystem/Platform/plat_ver.fs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System/OperatingSystem/Platform/plat_ver.vb" id="Snippet1":::
]]>
Property
mscorlib
2.0.0.0
2.0.5.0
4.0.0.0
netstandard
2.0.0.0
2.1.0.0
System.Runtime.Extensions
4.2.0.0
4.2.1.0
4.2.2.0
System.Runtime
5.0.0.0
6.0.0.0
7.0.0.0
8.0.0.0
9.0.0.0
10.0.0.0
11.0.0.0
System.String
Gets the concatenated string representation of the platform identifier, version, and service pack that are currently installed on the operating system.
The string representation of the values returned by the , , and properties.
is the same as the value returned by the method. However, an implementation of the .NET Framework for a different platform might return a more appropriate string for that platform.
For a list of Windows operating system versions and their corresponding version numbers, see [Operating System Version](/windows/win32/sysinfo/operating-system-version).
## Examples
The following code example demonstrates the property.
:::code language="csharp" source="~/snippets/csharp/System/OperatingSystem/VersionString/osvs.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/System/OperatingSystem/VersionString/osvs.fs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System/OperatingSystem/VersionString/osvs.vb" id="Snippet1":::
]]>