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

Implicit package references can be displayed as explicit #9090

Closed
drewnoakes opened this issue Jun 15, 2023 · 1 comment · Fixed by #9370
Closed

Implicit package references can be displayed as explicit #9090

drewnoakes opened this issue Jun 15, 2023 · 1 comment · Fixed by #9370
Assignees
Labels
Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references Regression Regressions from a previous (typically public) build or release. Triage-Approved Reviewed and prioritized
Milestone

Comments

@drewnoakes
Copy link
Member

During the rewrite of the dependencies tree in #9008, the following issue crept in.

"Implicit" package references (i.e. those which were added via imported project files, not directly by the project file itself) are supposed to be displayed with a padlock icon indicating that they cannot be manually removed from the project. This icon is no longer displayed for package references following the rewrite.

In the dotnet/project-system repo, most of these packages are implicit, and should be displayed with a padlock overlay:

image

Investigation shows that the evaluated item has IsImplicitlyDefined set to true, however the resolved item from the design-time build does not. It only shows IsImplicitlyDefined as false.

Looking into the SDK it seems the ResolvePackageAssets task only tracks a few well known packages, reporting them as implicitly defined (Microsoft.NETCore.App and NETStandard.Library).

In this example, the Figgle package was imported via a Directory.Build.props file so should be identified as implicitly defined, but is not.

image

I don't see any change in the SDK around this so believe the change in behaviour to have come from the rewrite in #9008.

That said, the best fix might actually be in the SDK. We should investigate whether we can determine this value, such as by inspecting the defining project for the item (as is done for the unresolved/evaluated item). We can keep a more elegant dependency tree implementation if we use MSBuild to massage the data into a correct and consistent format for ingestion by the tree, rather than having C# code to juggle inconsistent and incorrect values due to known problems.

The impact of this regression is reasonably low, but it would be great to fix it.

@drewnoakes drewnoakes added Bug Regression Regressions from a previous (typically public) build or release. Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references labels Jun 15, 2023
@drewnoakes drewnoakes changed the title Implicit package references can be displayed an explicit Implicit package references can be displayed as explicit Jun 15, 2023
@melytc melytc added the Triage-Approved Reviewed and prioritized label Jun 29, 2023
@melytc melytc added this to the 17.8 milestone Jun 29, 2023
@drewnoakes drewnoakes modified the milestones: 17.8, 17.9 Sep 12, 2023
@drewnoakes
Copy link
Member Author

This was fixed in #9370:

image

@drewnoakes drewnoakes self-assigned this Feb 12, 2024
@drewnoakes drewnoakes removed the Bug label Oct 16, 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 Regression Regressions from a previous (typically public) build or release. Triage-Approved Reviewed and prioritized
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants