Repository navigation
Graph
MSBuild Structured Log Viewer now includes a graph viewer control. You can use it to view the project reference graph:
Target graph for a given project evaluation:

as well as other kinds of graphs.
The vertices are organized into horizontal layers by the height of each vertex. 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).
A project will be a deeper shade of blue if it has larger depth. Depth is defined similarly to height, but from the opposite end. Unreferenced projects have a depth of 0, and for a referenced project the depth is one bigger than the maximum depth of all projects referencing the given one. Projects with bigger depth will also have a slightly bigger rectangle.
Check the Layer by depth checkbox to order the layers by node depth. This way all unreferenced projects (depth = 0) will be in the bottom most layer.
Some people have different mental models about whether more foundational layers are at the top or on the bottom. Use the Invert checkbox to flip the graph to the opposite end.
Some people may also prefer flipping the direction from vertical to horizontal, using the Horizontal checkbox.
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.
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).
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.
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
}
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 -gwhich will output the assembly dependency graph to a file in the current directory. You can then open the graph 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