Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Fix framework ordering if graphs #5542

Merged
merged 1 commit into from
Mar 25, 2019
Merged

Conversation

vitek-karas
Copy link
Member

If both the app and framework (for example ASP.NET) have dependency on the root Microsoft.NETCore.App and these references are for different versions the product may not find hostpolicy.

The problem happens if the framework (ASP.NET for example) has a reference to lower (but still compatible) version to what the app has. In such case the app will resolve the framework and put it into the list. Then we process ASP.NET framework which gets added to the end of that list as well. And then we process references for ASP.NET, we find that the reference to NETCore.App is compatible with the one we already have (soft-roll-forward). In this case the NETCore.App should be moved to the end of the list (the list is ordered such that the root framework should be last), but the code used to only do that if the versions were an exact match.

The fix is to always move the dependent framework to the last position.

Tests we already added as part of the framework resolution test improvement, but commented out as they were failing. Just uncommenting the tests.

Fixes #4947

If both the app and framework (for example ASP.NET) have dependency on the root Microsoft.NETCore.App and these references are for different versions the product may not find `hostpolicy`.

The problem happens if the framework (ASP.NET for example) has a reference to lower (but still compatible) version to what the app has. In such case the app will resolve the framework and put it into the list. Then we process ASP.NET framework which gets added to the end of that list as well. And then we process references for ASP.NET, we find that the reference to NETCore.App is compatible with the one we already have (soft-roll-forward). In this case the NETCore.App should be moved to the end of the list (the list is ordered such that the root framework should be last), but the code used to only do that if the versions were an exact match.

The fix is to always move the dependent framework to the last position.

Tests we already added as part of the framework resolution test improvement, but commented out as they were failing. Just uncommenting the tests.
@vitek-karas vitek-karas added this to the 3.0 milestone Mar 24, 2019
@vitek-karas vitek-karas self-assigned this Mar 24, 2019
@vitek-karas vitek-karas requested a review from elinor-fung March 24, 2019 09:12
@vitek-karas vitek-karas merged commit b29f3d5 into dotnet:master Mar 25, 2019
@vitek-karas vitek-karas deleted the Bug4947 branch March 25, 2019 17:37
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
If both the app and framework (for example ASP.NET) have dependency on the root Microsoft.NETCore.App and these references are for different versions the product may not find `hostpolicy`.

The problem happens if the framework (ASP.NET for example) has a reference to lower (but still compatible) version to what the app has. In such case the app will resolve the framework and put it into the list. Then we process ASP.NET framework which gets added to the end of that list as well. And then we process references for ASP.NET, we find that the reference to NETCore.App is compatible with the one we already have (soft-roll-forward). In this case the NETCore.App should be moved to the end of the list (the list is ordered such that the root framework should be last), but the code used to only do that if the versions were an exact match.

The fix is to always move the dependent framework to the last position.

Tests we already added as part of the framework resolution test improvement, but commented out as they were failing. Just uncommenting the tests.

Commit migrated from dotnet/core-setup@b29f3d5
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mismatched shared framework versions can cause failed resolution of hostpolicy in certain circumstances
2 participants