Use dependency ID in project tree flags correctly #9371
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.
Dependency nodes in the tree have various flags, which allow other code to inspect dependencies in order to interact with them (commands, attaching children, etc.).
Flags are computed via the virtual
UpdateTreeFlags
method, and certain MSBuild dependency factories override this method to include additional logic.For package dependencies, the dependency's ID is added as a flag of form
$ID:MyPackage
.An unresolved package dependency has item spec
MyPackage
, whereas the resolved form includes the versionMyPackage/1.2.3
. The code was incorrectly passing the resolved form, including the version. This change ensures we pass the ID, which is consistent regardless of whether the dependency is resolved or not.This fix could, under certain timing conditions, fix issues where child nodes are not attached correctly to package nodes in the tree.
Microsoft Reviewers: Open in CodeFlow