Skip to content
Kirill Osenkov edited this page Jul 30, 2025 · 23 revisions

The viewer now includes a graph viewer control. You can use it to view the project reference graph:

image

Layers by height

The projects are organized into horizontal layers by the height of each node. A project's height is defined as follows:

  • projects that don't have any references have the height of 0
  • if the maximum height of the project's reference is N, then the height of the project itself is N + 1

A project can only reference projects from the layers above it. A project can't reference projects from the same layer or from the layers beneath it.

Within a layer, projects are ordered by in-degree (number of projects that reference it) descending. Thus, more "popular" projects that are referenced more appear towards the left. The spine of the graph is along the left vertical edge (most popular projects in each layer).

Finding projects

To find a project in a large graph, type the partial project file name into the textbox and click Locate on canvas. Once a project is selected, you can click Go to search to list the project's outgoing and incoming references using the $projectreference syntax described here.

Outgoing and incoming references

Clicking on a project shows all outgoing references (above) and all incoming references (below). If there are too many references, check the Hide transitive references checkbox to only show the transitive reduction of the graph. It doesn't change the graph connectedness (if two vertices were connected, they will still be connected, albeit indirectly).

Connectedness and reachability

Ctrl+Click any two projects to see whether one references the other, and if so, what are the possible paths from one to the other.

image

Dot syntax

Click on Show graph text to get the Dot syntax for the current project reference graph:

digraph {
  "StructuredLogger.Tests" -> "StructuredLogViewer.Core"
  "StructuredLogger.Tests" -> StructuredLogger
  "StructuredLogger.Utils" -> StructuredLogger
  "StructuredLogViewer.Avalonia" -> "StructuredLogViewer.Core"
  "StructuredLogViewer.Avalonia" -> StructuredLogger
  "StructuredLogViewer.Core" -> StructuredLogger
  BinlogTool -> "StructuredLogger.Utils"
  BinlogTool -> StructuredLogger
  StructuredLogViewer -> "StructuredLogger.Utils"
  StructuredLogViewer -> "StructuredLogViewer.Core"
  StructuredLogViewer -> StructuredLogger
  StructuredLogViewer -> TaskRunner
  TaskRunner -> "StructuredLogViewer.Core"
  TaskRunner -> StructuredLogger
}

Viewing arbitrary graphs in .dot format

You can use File -> Open Graph to open arbitrary directed graph files in .dot format.

As an example, you can obtain a graph for a directory with .dll files by running the refdump .NET tool: dotnet tool update -g refdump refdump -g which will output the assembly dependency graph to a file in the current directory. You can then open the .dot file using File -> Open Graph. It will display in a separate graph control that's not related to the build. The MSBuild Structured Log Viewer is opening directed graph files as a convenience.

See also the Dependency Analyzer tool by Drew Noakes: https://github.com/drewnoakes/dependency-analyser

Clone this wiki locally