dotnet / project-system

The .NET Project System for Visual Studio
MIT License
959 stars 386 forks source link

Implicit state overlay not appearing on package dependency nodes #9368

Closed drewnoakes closed 5 months ago

drewnoakes commented 6 months ago

Before the dependencies tree rewrite in #9008, PackageReference MSBuild items defined outside of the current project's .csproj file would be displayed with a padlock overlay, indicating it's an implicit reference, which may not be removed from the project. Those overlays are no longer visible.

To repro this, create a project and add one package reference to it, and add a Directory.Build.props file with a different package reference in it.

image

In this example, Figgle is added in Directory.Build.props and should show as implicit.

We can see this state works for framework and analyzer nodes:

image


Beyond the lack of visual indicator, we use the implicit state to prevent attempts at deletion by hiding the "Remove" context menu command. In the above screenshot if you attempt to remove the "Figgle" package, you see this error:

image