Skip to content
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]: Change to default RID when targeting .NET Framework #43692

Open
1 of 3 tasks
marcpopMSFT opened this issue Nov 21, 2024 · 0 comments
Open
1 of 3 tasks
Assignees
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.

Comments

@marcpopMSFT
Copy link
Member

marcpopMSFT commented Nov 21, 2024

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

  • Binary incompatible: Existing binaries might 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 might require source changes to compile successfully.
  • Behavioral change: Existing binaries might behave differently at run time.

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

@marcpopMSFT marcpopMSFT added breaking-change Indicates a .NET Core breaking change doc-idea Indicates issues that are suggestions for new topics [org][type][category] Pri1 High priority, do before Pri2 and Pri3 labels Nov 21, 2024
@dotnetrepoman dotnetrepoman bot added ⌚ Not Triaged Not triaged source incompatible Source code may encounter a breaking change in behavior when targeting the new version. labels Nov 21, 2024
@dotnetrepoman dotnetrepoman bot added 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. and removed 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. labels Nov 21, 2024
@gewarren gewarren added 🗺️ reQUEST Triggers an issue to be imported into Quest. and removed doc-idea Indicates issues that are suggestions for new topics [org][type][category] ⌚ Not Triaged Not triaged breaking-change Indicates a .NET Core breaking change Pri1 High priority, do before Pri2 and Pri3 source incompatible Source code may encounter a breaking change in behavior when targeting the new version. labels Nov 21, 2024
@dotnetrepoman dotnetrepoman bot added the source incompatible Source code may encounter a breaking change in behavior when targeting the new version. label Nov 21, 2024
@sequestor sequestor bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Nov 22, 2024
@dotnetrepoman dotnetrepoman bot added ⌚ Not Triaged Not triaged and removed ⌚ Not Triaged Not triaged labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
Status: 🔖 Ready
Development

No branches or pull requests

2 participants