Master dependency visualization for .NET and C# projects. Learn to use Visual Studio, JetBrains Rider, NDepend, and open-source tools to understand project relationships, detect circular dependencies, and analyze coupling in your solutions.
A C# dependency graph (or project dependency diagram) visualizes how projects in a Visual Studio solution depend on each other. Each node represents a project (assembly), and arrows show which projects reference which.
Unlike code-level dependency graphs, C# dependency graphs operate at the project/assembly level, showing:
Solutions with 50+ projects become impossible to navigate mentally. A visual graph shows architecture at a glance.
When Project A → B → C → A, nothing can compile. Dependency graphs spot these immediately.
Before moving code or deleting a project, see what depends on it and what might break.
Tight coupling between projects signals architectural problems. Visualize coupling to prioritize refactoring.
New team members understand the codebase structure in minutes instead of weeks.
When splitting a monolith, dependency graphs show natural boundaries for services.
Visual dependency graphs make these relationships immediately obvious, whereas text lists require careful reading.
Built-in (Enterprise)
Architecture > Dependency Diagram
Auto-generates from solution
Validate code against diagram
Only in VS Enterprise edition
Built-in (All Editions)
Tools > Architecture > Show Project Diagram
Real-time coupling analysis
Thin/thick lines for usage count
Compare snapshots over time
| Tool | Price | Key Features | Best For |
|---|---|---|---|
| NDepend | $595-990/yr | Dependency graph, matrix view, CQLinq rules, code metrics, compliance reports | Enterprise quality gates, CI/CD integration, legacy code audits |
| Visual Studio Enterprise | $550/mo | Dependency diagram, layer validation, code map | Large teams already using VS, tight integration |
| Rider (Professional+) | $15-25/mo | Project diagram, coupling analysis, type dependency graph, snapshots | Cross-platform development, JetBrains ecosystem |
| Resharper | $10-20/mo | Dependency diagram, dead code detection, architecture explorer | Visual Studio plugin, existing users |
Parse .NET assemblies. Build custom dependency analysis tools. Low-level, requires coding.
GitHub FreeOfficial Microsoft compiler API. Analyze C# source code, detect dependencies at compile time.
GitHub FreeOpen-source tool: marccarre/DependencyGraph. CLI tool for C# dependency visualization.
GitHub FreeVSCode C# Dependency Graph extension. Lightweight visualization in the editor.
VSCode FreeExport dependency data as Graphviz DOT files. Render with online or local Graphviz tools.
Standard FreeText-based syntax for dependency graphs. Render in GitHub, docs, or online editor.
Text-Based FreeHow to fix: Extract shared interfaces/models into a third, independent project.
Core → Data → Services → API. Create separate projects per layer to enforce layering.
Core shouldn't reference API. Data shouldn't reference Services. Only downward arrows.
DI containers (DryIoc, Autofac, Serilog) decouple projects better than direct references.
When two projects need the same code, create a shared project instead of creating circular dependencies.
Review dependency graphs quarterly. New circular deps creep in during active development.
Use NDepend or Rider in CI to fail builds on circular dependencies or unexpected coupling.
Instead of a graph, some tools show a Dependency Structure Matrix (DSM)—a grid where rows and columns are projects, and cells show dependencies. This view is better for large solutions (100+ projects) because graphs become too cluttered.
NDepend and Rider both support matrix views. Visual Studio does not (Enterprise graphs only).
👤 Individual / Small Team (2-5 people)
→ JetBrains Rider Community / Professional ($15/mo) — Best value, all features
🏢 Medium Team (5-30 people)
→ Rider Professional + NDepend ($25-30/person/mo) — IDE + enterprise analysis
🏛️ Enterprise (30+ people)
→ Visual Studio Enterprise + NDepend — Full integration, governance, compliance
💰 Budget-Conscious
→ Open-source (Roslyn, DependencyGraph) — Free, requires some coding