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

Fix calculation of implicit state for package dependencies #9370

Merged

Conversation

drewnoakes
Copy link
Member

@drewnoakes drewnoakes commented Jan 10, 2024

Fixes #9368
Fixes #9090

We have two ways of detecting whether a dependency is "implicit": via IsImplicitlyDefined and DefiningProjectFullPath metadata.

It turns out we need to consider both evaluation and build metadata when computing whether package dependencies are implicit. Packages incorrectly advertise IsImplicitlyDefined as false in build data, while its evaluation properties show the DefiningProjectFullPath as differing from the project's path. So this change prioritises DefiningProjectFullPath over IsImplicitlyDefined, to work around the incorrect value in build data, and includes both evaluation and build properties, to allow reading the DefiningFullPath value when processing a build update.

Microsoft Reviewers: Open in CodeFlow

We have two ways of detecting whether a dependency is "implicit": via `IsImplicitlyDefined` and `DefiningProjectFullPath` metadata.

It turns out we need to consider both evaluation and build metadata when computing whether package dependencies are implicit. Packages incorrectly advertise `IsImplicitlyDefined` as `false` in build data, while its evaluation properties show the `DefiningProjectFullPath` as differing from the project's path. So this change prioritises `DefiningProjectFullPath` over `IsImplicitlyDefined`, to fix the first bug, and includes both evaluation and build properties, to fix the second.
@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:28
@drewnoakes
Copy link
Member Author

With this fix, the scenario in the linked issue now displays correctly:

image

@drewnoakes drewnoakes added the Bug label Jan 10, 2024
@drewnoakes drewnoakes merged commit 048d517 into dotnet:main Jan 11, 2024
5 checks passed
@drewnoakes drewnoakes deleted the fix-9368-package-dependency-implicit-overlay branch January 11, 2024 22:20
@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
2 participants