[Breaking change]: Change to default RID when targeting .NET Framework #43692
Labels
📌 seQUESTered
Identifies that an issue has been imported into Quest.
source incompatible
Source code may encounter a breaking change in behavior when targeting the new version.
Description
In .NET 8, we introduced a change to use a smaller RID graph when targeting net8.0 and higher: https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/rid-graph
However, this breaks customers who are multi-targeting between net8 and .NET Framework as the restore happens once but the Framework project tries to use the old RID default and the .NET Core project tries to use the new reduced RID-graph.
To enable this multi-targeting scenario, we switched to using a default RID in this scenario that is compatible with the new RID graph.
Version
.NET 9 GA
Previous behavior
.NET Framework targeted SDK-style projects with no RID set would default to win7-x86 or win7-x64.
New behavior
.NET Framework targeted SDK-style projects with no RID set would default to win-x86 or win-x64.
Type of breaking change
Reason for change
.NET Framework applications were getting a default RID incompatible with our portable RID graph and would get a restore error:
Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1047: Assets file 'D:\a\_work\1\s\artifacts\obj\MSBuild\project.assets.json' doesn't have a target for 'net472/win7-x64'. Ensure that restore has run and that you have included 'net472' in the TargetFrameworks for your project. You may also need to include 'win7-x64' in your project's RuntimeIdentifiers. [MSBuild.csproj::TargetFramework=net472]
dotnet/sdk#35575
Recommended action
Update your RuntimeIdentifier to a value supported by the portable RID graph or switch back to the old RID graph by setting UseRidGraph=true.
Feature area
SDK
Affected APIs
No response
Associated WorkItem - 345577
The text was updated successfully, but these errors were encountered: