Don't omit Microsoft.NETCore.App from list of frameworks in runtimeconfig #17982
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In .NET Core 3.0, we added the ability to have multiple shared frameworks, which are listed in the runtimeconfig.json file. However, due to issues in the host, we omitted the base Microsoft.NETCore.App framework from the list in the runtimeconfig if there were any other frameworks.
The bugs in the host have long since been fixed (as far as I know). However, omitting the Microsoft.NETCore.App entry from the frameworks was causing issues in dotnet/sdk, where we override the version of the base framework. Projects that used a higher-level framework such as Microsoft.AspNetCore.App were loading the wrong version of Microsoft.NETCore.App, as the version compiled against wasn't listed in the runtimeconfig.
PR where we hit this: #17948
Commit with workaround: 150c6fa
This PR currently changes the logic so that Microsoft.NETCore.App will by default always be listed in the runtimeconfig when targeting .NET 6 or higher. In any case the
AlwaysIncludeCoreFrameworkInRuntimeConfig
property can be used to override the default behavior.I think the issues were fixed before .NET Core 3.0 released, so we might be able to always make the default to list all frameworks if the breaking change risk is low.