RuntimeInformation.RuntimeIdentifier Property
In this article
Definition
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 platform for which the runtime was built (or on which an app is running).
public:
static property System::String ^ RuntimeIdentifier { System::String ^ get(); };
public static string RuntimeIdentifier { get; }
static member RuntimeIdentifier : string
Public Shared ReadOnly Property RuntimeIdentifier As String
An opaque string that identifies the platform for which the runtime was built (or on which an app is running).
.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 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: