dependency-analyzer 0.7.1

dotnet tool install --global dependency-analyzer --version 0.7.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local dependency-analyzer --version 0.7.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dependency-analyzer&version=0.7.1
                    
nuke :add-package dependency-analyzer --version 0.7.1
                    

SolutionDependencyAnalyzer

There are two ways to use the tool: Command line or use the NuGet package in your project.

Command Line

Installation

dotnet tool install --global dependency-analyzer

Usage

dependency-analyzer <SolutionFullPath> <OutputPath>
Options
  • -g or --create-graph-image : runs dot at the end of the process to create a png image of the dot graph generated. This option has a prerequisite: dot must be installed and in the PATH. To do so, you can run this command for Chocolatey: choco install graphviz or get dot there.

Files Created

This tool will create five files in the provided OutputPath:

  • packages.md contains the list of NuGet packages used by the projects in the solution, with their version.
  • packagesByProject.md will list the NuGet packages used by each project in the solution, with their version.
  • projectsByPackage.md does the opposite: it will list the projects that use each package
  • projectDependencyGraph.dot is the dependency graph of the projects in the solution. SolutionDependencyAnalyzer also generates a png of that graph, projectDependencyGraph.png

Nuget Dependency

Installation

Add the dependency-analyzer NuGet package to your project

Usage

Create a DependencyAnalyzer and call it, with Solution containing the full solution path:

var dependencyAnalyzer = new DependencyAnalyzer(Solution);
await dependencyAnalyzer.AnalyzeAsync();

Now dependencyAnalyzer properties contain everything you need:

  • PackageResults contains the package ID as key, and its version as value
  • ProjectResults is a dictionary in which the key is a project, and the values are its project dependencies
  • PackagesByProject is a dictionary in which the key is a project, and the values are its package dependencies
  • ProjectsByPackage is a dictionary in which the key is a package, and the values are its project dependencies

You can also call the writers (MarkdownWriter and DotWriter) if you want to write the same fils as the comand line tool does.

Thanks

This project was heavily inspired by dotnet-depends, and like dotnet-depends, it uses the amazing Buildalyzer

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.7.1 6,328 2/7/2022
0.7.0 695 2/7/2022
0.6.0 1,331 2/23/2021
0.5.0 707 10/5/2020
0.4.0 688 4/28/2020
0.3.0 797 8/22/2019
0.2.0 686 8/13/2019
0.1.0 630 8/13/2019