This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Fix framework ordering if graphs #5542
Merged
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.
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