Project-system: Properties Window: display more information for referenced assembly properties

Created on 11 Oct 2018  路  7Comments  路  Source: dotnet/project-system

In the Properties Window for a selected assembly (that was referenced via PackageReference) show the full path to where the assembly was resolved from:

image

Ideally also show the assembly full name, such as version and public key token.

Feature Request Feature-Dependency-Node Help Wanted Triage-Approved

Most helpful comment

Related to #927.

First, some background:

The first level of nodes directly under the NuGet node are the packages that are directly referenced by the project. All the nodes under those are "transitive" dependencies of some sort, including the assembly reference to GuiLabs.Canvas.dll shown in the original post. This is important because information about the direct dependencies goes down one code path, and information about the transitive dependencies goes down another. This is why nodes directly under the Assemblies node have one set of properties, and nodes for assemblies under NuGet packages have... mostly nothing.

To return these properties, you're going to need to update the implementation of DependenciesGraphProvider.GetExtension<T> (which currently does nothing) to return an implementation of Microsoft.VisualStudio.GraphModel.IGraphNodeBrowsablePropertiesProvider. That implementation will need to map from an input GraphNode back to a Dependency instance and then create a System.ComponentModel.PropertyDescriptorCollection containing all the additional data that should appear in the Properties window.

I realize that's not a lot to go on, but that's as far as I've gotten in figuring out how to show properties for all these transitive dependencies.

All 7 comments

where in the code would this be located if someone would want to have a look at fixing this?

Tagging @tmeschter and @drewnoakes. I assume this is somewhere in the dependencies node code - probably on the Graphnodes described in https://github.com/dotnet/project-system/blob/master/docs/repo/dependencies-node-roadmap.md

(and welcome to the repo!)

Related to #927.

First, some background:

The first level of nodes directly under the NuGet node are the packages that are directly referenced by the project. All the nodes under those are "transitive" dependencies of some sort, including the assembly reference to GuiLabs.Canvas.dll shown in the original post. This is important because information about the direct dependencies goes down one code path, and information about the transitive dependencies goes down another. This is why nodes directly under the Assemblies node have one set of properties, and nodes for assemblies under NuGet packages have... mostly nothing.

To return these properties, you're going to need to update the implementation of DependenciesGraphProvider.GetExtension<T> (which currently does nothing) to return an implementation of Microsoft.VisualStudio.GraphModel.IGraphNodeBrowsablePropertiesProvider. That implementation will need to map from an input GraphNode back to a Dependency instance and then create a System.ComponentModel.PropertyDescriptorCollection containing all the additional data that should appear in the Properties window.

I realize that's not a lot to go on, but that's as far as I've gotten in figuring out how to show properties for all these transitive dependencies.

@tmeschter thanks! is there an actual (C#) example somewhere that shows how this is done for other transitive dependencies? (I only found some references to VB code related to PropertyDescriptorCollection in this repo). Or is the "first/only" place where such transitive dependencies exist currently?

@japj No, it's something we've discussed but never implemented.

The references to PropertyDescriptorCollection in VB code are unrelated. The most they will do for you is provide an example of how to use that type.

This was fixed in #6155. We show more information within packages (content files, compile time assemblies, framework assemblies) and each has more information in its browse object to display in the properties window.

Was this page helpful?
0 / 5 - 0 ratings