projectreferences - Project References

Overview

The projectreferences command analyzes a project and shows both the projects it depends on (outbound references) and the projects that depend on it (inbound references). This helps you understand the dependency relationships in your solution.

Syntax

nmbl projectreferences <Project>

Arguments

Output

Displays two lists:

  1. Outbound references - Projects that this project depends on
  2. Inbound references - Projects that depend on this project

Examples

Analyze a Core Project

nmbl projectreferences src/Core/Domain/Domain.csproj

Shows which projects depend on your domain layer and what it depends on.

Check API Dependencies

nmbl projectreferences src/Web/Api/Api.csproj

Understand what the API project references and what references it.

Validate Architecture

# Check that infrastructure doesn't depend on web
nmbl projectreferences src/Infrastructure/Infrastructure.csproj

# Check that domain has no dependencies (clean architecture)
nmbl projectreferences src/Core/Domain/Domain.csproj

Verify your architecture follows dependency rules.

Find Unused Projects

# If a project shows no inbound references, it might be unused
nmbl projectreferences src/Legacy/OldLibrary/OldLibrary.csproj

Identify projects that nothing depends on.

Use Cases

Architecture Validation

Ensure your layered architecture is correctly structured:

# Domain should have no project references
nmbl projectreferences src/Domain/Domain.csproj

# Application should only reference Domain
nmbl projectreferences src/Application/Application.csproj

# Infrastructure can reference Application and Domain
nmbl projectreferences src/Infrastructure/Infrastructure.csproj

Refactoring Planning

# Before splitting a project, see what depends on it
nmbl projectreferences src/Shared/Shared.csproj

Understand the impact of breaking apart a project.

Dependency Analysis

# Check all projects in a solution
for proj in src/*/*.csproj; do
  echo "=== $proj ==="
  nmbl projectreferences "$proj"
done

Get a complete picture of all project relationships.

Understanding the Output

Outbound References (Dependencies)

Inbound References (Dependents)