RuntimeInformation.RuntimeIdentifier Property

Definition

Gets the platform for which the runtime was built (or on which an app is running).

C#
public static string RuntimeIdentifier { get; }

Property Value

An opaque string that identifies the platform for which the runtime was built (or on which an app is running).

Remarks

.NET 8 and later versions: This property returns a string that identifies the operating system and processor architecture for which the runtime was built. For example, the value on Windows 11 is win-x64, and on Ubuntu 20.04, it's linux-x64.

.NET 7 and earlier versions: This property returns a string that identifies the platform (operating system, version, and processor architecture) on which the current process is running. For example, when running an application on Windows 11, the value is win10-x64, and on Ubuntu 20.04, it can be ubuntu.20.04-x64.

Since this string is opaque, it's not recommended to parse the string into its constituent parts.

For more information, see .NET RID catalog.

Applies to

Product Versions
.NET 5, 6, 7, 8, 9