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
Project- Path to a .csproj file
Output
Displays two lists:
- Outbound references - Projects that this project depends on
- Inbound references - Projects that depend on this project
Examples
Analyze a Core Project
nmbl projectreferences src/Core/Domain/Domain.csprojShows which projects depend on your domain layer and what it depends on.
Check API Dependencies
nmbl projectreferences src/Web/Api/Api.csprojUnderstand 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.csprojVerify 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.csprojIdentify 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.csprojRefactoring Planning
# Before splitting a project, see what depends on it
nmbl projectreferences src/Shared/Shared.csprojUnderstand 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"
doneGet a complete picture of all project relationships.
Understanding the Output
Outbound References (Dependencies)
- Projects listed here are required by the analyzed project
- Changes to these projects may affect the analyzed project
Inbound References (Dependents)
- Projects listed here depend on the analyzed project
- Changes to the analyzed project may affect these projects
Related Commands
Prev
iterate