[release/7.0-staging] Check for <framework_name>.deps.json when enumerating framework paths #92033
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.
This adds a check for the framework's .deps.json instead of just the existence of the directory. To avoid extra file checks in the normal/happy path (where all framework version folder are valid), when resolving, it only does the check after resolving the best version match. And if that version directory isn't valid, it tries resolving again without it.
Backport of #90035
Customer Impact
The host treats the existence of a framework folder as a valid framework path. We've seen this cause issues as users can end up in this state without their knowledge - for example, uninstall leaves an empty folder, which would normally be harmless, except when we try to use it as a valid framework. This results in applications failing to run because we try to use that path as a framework. When users get into this state, it is not clear what is wrong and how to address it. They also remain in this broken state - typically until the framework is reinstalled or a newer version is installed.
See #91806, #48180
Testing
Automated tests added. Manual validation.
Risk
Low. The fix itself is fairly surgical - however, the change is on a path that every application will hit.