projectreferences - Project References
The projectreferences command analyzes a .slnx solution and reports the inbound and outbound project-to-project references for a specified target project. Inbound references are projects that depend on the target; outbound references are projects the target depends on. Paths are shown relative to the solution root.
The solution file is resolved automatically from the current directory when not supplied explicitly.
nmbl projectreferences <ProjectFileOrFolderOrName> [--solution <SlnxFileOrDirectory>]
or using the positional convention:
nmbl projectreferences <SolutionPathOrDir> <ProjectFileOrFolderOrName>
ProjectFileOrFolderOrName- Required. Identifies the target project. Accepted values:- Absolute path to a
.csprojfile - Relative path to a
.csprojfile (resolved from the solution directory) - Path to a directory containing exactly one
.csprojfile - A project name substring (matched against project file names in the solution)
- Absolute path to a
- First argument — path to a
.slnxfile or a directory containing one. - Second argument — project identifier (same options as above).
--solution,-s,--solutiondir <SlnxFileOrDirectory>- Explicit path to a.slnxfile or a directory containing one. When omitted, the solution is resolved by searching upward from the current directory.
Prints the resolved target project path, then two lists:
Target project:
src/MyProject/MyProject.csproj
Inbound references (projects that reference this project):
- src/Web/Web.csproj
- tests/MyProject.Tests/MyProject.Tests.csproj
Total inbound: 2
Outbound references (projects this project references):
- src/Core/Domain/Domain.csproj
Total outbound: 1
0- Success.1- Required arguments are missing, the solution or project cannot be resolved, or an unexpected error occurs.
nmbl projectreferences src/MyLib/MyLib.csproj
Resolves the solution from the current directory and shows references for MyLib.csproj.
nmbl projectreferences src/MyLib
Finds the single .csproj in src/MyLib and analyzes it.
nmbl projectreferences MyLib --solution C:/path/to/MySolution.slnx
nmbl projectreferences MyLib --solution C:/path/to/solution/folder
nmbl projectreferences . src/MyLib
First argument is the solution directory (. searches the current directory for a .slnx file); second argument is the project folder.
# Domain should have no outbound project references
nmbl projectreferences src/Domain/Domain.csproj
# Application should only reference Domain
nmbl projectreferences src/Application/Application.csproj
# A project with no inbound references may be unused
nmbl projectreferences src/Legacy/OldLibrary/OldLibrary.csproj
- Inbound references — projects that reference the target. Changes to the target may affect these projects.
- Outbound references — projects that the target depends on. Changes to those projects may affect the target.