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 Debian 12, it's linux-x64. Since this value represents the platform for which the runtime was built, it may differ depending on the installation source. Microsoft-built runtimes use portable RIDs like linux-x64 that can run on multiple Linux distributions. However, some Linux distributions provide their own packages built specifically for that distribution and version, which may return more specific RIDs like ubuntu.24.10-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 Debian 12, it can be debian.12-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, 10