Description
Description
Projects targeting .NET 8 and higher will by default use a smaller, "portable" RuntimeIdentifier graph.
PR: dotnet/sdk#34279
cc @dsplaisted
Related:
- https://learn.microsoft.com/dotnet/core/compatibility/deployment/8.0/rid-asset-list
- [Breaking change]: RuntimeInformation.RuntimeIdentifier returns platform for which the runtime was built #36466
Version
.NET 8 RC 1
Previous behavior
The .NET SDK used a complex RID graph to determine assets when building or publishing a project.
New behavior
The .NET SDK, for projects targeting .NET 8, will use a smaller graph consisting of only portable RIDs. This means that it will not recognize version/distro-specific RIDs by default.
Type of breaking change
- Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
- Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code may require source changes to compile successfully.
- Behavioral change: Existing binaries may behave differently at run time.
Reason for change
The RID graph was costly to maintain and understand, requiring .NET itself to be distro-aware in a fragile manner. The .NET team and the community spend a non-trivial amount of time updating the graph and backporting such updates to previous releases. The long-term goal is to stop updating the RID graph, stop reading it, and eventually remove it. This breaking change is a step towards that goal.
Recommended action
Use portable RIDs, for example, linux-<arch>
, linux-musl-<arch>
, osx-<arch>
, and win-<arch>
.
If you need to revert to the previous behaviour of using the old, full RID graph, you can set the UseRidGraph
property to true in your project. Note that the old RID graph will not be updated to attempt to handle any other distros / architectures.
Feature area
SDK
Affected APIs
No response