10

I have VS 2010 professional edition. What can I do to use "Dependency Graph". I do not have "architectural" edition. Is there a FREE plugin that I could use. If not, are there any FREE 3rd party tools that could help me do the same thing.

Thanks

dotnet-practitioner
  • 13,968
  • 36
  • 127
  • 200

5 Answers5

14

I needed something similar, but didn't want to pay for (or install) a tool to do it. I created a quick PowerShell script that goes through the project references and spits them out in a yuml.me friendly-format instead:

Function Get-ProjectReferences ($rootFolder)
{
    $projectFiles = Get-ChildItem $rootFolder -Filter *.csproj -Recurse
    $ns = @{ defaultNamespace = "http://schemas.microsoft.com/developer/msbuild/2003" }

    $projectFiles | ForEach-Object {
        $projectFile = $_ | Select-Object -ExpandProperty FullName
        $projectName = $_ | Select-Object -ExpandProperty BaseName
        $projectXml = [xml](Get-Content $projectFile)
        
        $projectReferences = $projectXml | Select-Xml '//defaultNamespace:ProjectReference/defaultNamespace:Name' -Namespace $ns | Select-Object -ExpandProperty Node | Select-Object -ExpandProperty "#text"
        
        $projectReferences | ForEach-Object {
            "[" + $projectName + "] -> [" + $_ + "]"
        }
    }
}

Get-ProjectReferences "C:\Users\DanTup\Documents\MyProject" | Out-File "C:\Users\DanTup\Documents\MyProject\References.txt"

Sample Graph
(source: yuml.me)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275
6

dependency-analyser can help you.

http://code.google.com/p/dependency-analyser/

enter image description here

Morten Frederiksen
  • 5,114
  • 1
  • 40
  • 72
3

http://dependencyvisualizer.codeplex.com/ might help. You didn't say if you need something that goes beyond project-level dependencies.

Zian Choy
  • 2,846
  • 6
  • 33
  • 64
  • The downloadable version does not support VS2010. You will need to compile from source if you want to analyse VS2010 + – Darbio Aug 16 '12 at 02:46
2

You have also the VS Solution Dependency Viewer which supports VS2010 and is free for freeware/evaluation projects. You can download it directly from GForge: VS Solution Dependency Viewer project page.

Wernight
  • 36,122
  • 25
  • 118
  • 131
1

The NDepend tool does both dependency graph and dependency matrix (objectively 100x faster than VS2010 graph actually) but it is not free.

However you can download and use free trial for a while. And if you are working on an OSS project, contact us and we'll be happy to sponsor your OSS project with a free license (I am part of the tool team):

More on NDepend Dependency Graph enter image description here

More on NDepend Dependency Matrix: enter image description here

Patrick from NDepend team
  • 13,237
  • 6
  • 61
  • 92