-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Breaking change]: RuntimeInformation.RuntimeIdentifier returns platform for which the runtime was built #36466
Closed
1 of 3 tasks
Labels
breaking-change
Indicates a .NET Core breaking change
📌 seQUESTered
Identifies that an issue has been imported into Quest.
Comments
Thanks. That last sentence there was also impressive - apparently I decided to stop being comprehensible in that section. Fixed. |
3 tasks
This was referenced Aug 24, 2023
This was referenced Sep 6, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking-change
Indicates a .NET Core breaking change
📌 seQUESTered
Identifies that an issue has been imported into Quest.
Description
RuntimeInformation.RuntimeIdentifier
will return the platform for which the runtime was built, rather than a value computed at run time.PR: dotnet/runtime#89598
Related:
Version
.NET 8 RC 1
Previous behavior
The value was a RID computed via OS files and/or APIs. This generally meant it was a version-specific and distro-specific RID. For example, when running an application on Windows 11, it would be
win10-x64
or on Ubuntu 20.04, it could beubuntu.20.04-x64
.New behavior
The value is the RID for which the runtime was built. This means that for portable builds of the runtime (all Microsoft-provided builds), it will be non-version-specific and non-distro-specific. For example, when on Windows 11, it would be
win-x64
or on Ubuntu 20.04,linux-x64
. For non-portable builds (source-build), the build sets a build RID at that can have a version/distro and that value is the RID for the runtime will return.Type of breaking change
Reason for change
This is in line with a .NET 8 change to RID-specific asset resolution and the move away from a distro-aware runtime.
RuntimeInformation.RuntimeIdentifier
is an opaque value that should represent the platform on which the host/runtime considers itself to be running. In .NET 8, that corresponds to the platform for which the host/runtime is built, rather than a RID computed at run time.Recommended action
RuntimeInformation.RuntimeIdentifier
is an opaque value and not intended to be parsed into its component parts. For the OS version of the actual machine an application is running on,Environment.OSVersion
can be used. For a description,RuntimeInformation.OSDescription
can be used. For a specific ID (distro) and corresponding version on Linux, users would have to read the os-release file.Feature area
Core .NET libraries
Affected APIs
RuntimeInformation.RuntimeIdentifier
Associated WorkItem - 156743
The text was updated successfully, but these errors were encountered: