Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dependency ID in project tree flags correctly #9371

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

drewnoakes
Copy link
Member

@drewnoakes drewnoakes commented Jan 10, 2024

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 version MyPackage/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

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 version `MyPackage/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.
@drewnoakes drewnoakes added the Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references label Jan 10, 2024
@drewnoakes drewnoakes requested a review from a team as a code owner January 10, 2024 00:41
@drewnoakes drewnoakes added the Bug label Jan 10, 2024
@drewnoakes drewnoakes merged commit 500f281 into dotnet:main Jan 11, 2024
5 checks passed
@drewnoakes drewnoakes deleted the fix-tree-flag-for-packages branch January 11, 2024 21:54
@ghost ghost added this to the 17.9 milestone Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants