.N .NET Landscape

NsDepCop

CLI & Developer Tooling
github.com/realvizu/NsDepCop

NsDepCop is a static code analysis tool that enforces namespace and assembly dependency rules in C# projects.

csharpdependenciesdependency-analysisdotnetmsbuildnamespacenugetstatic-code-analysisvisual-studio-extension
GitHub stars
300
Forks
38
Open issues
15
NuGet downloads
3,322,800
latest 3.2.0
License
GPL-2.0
Language
C#
Last push
20 days ago
4 Oct 2026
Created
21 Jul 2016

NsDepCop - Namespace and Assembly Dependency Checker Tool for C#

NsDepCop is a static code analysis tool that enforces namespace and assembly dependency rules in C# projects.

  • It runs as part of the build process and reports any dependency problems.
  • No more unplanned or unnoticed dependencies in your system.

What is this dependency control anyway? And why should you automate it?

Getting Started

  1. Add the NsDepCop NuGet package to your C# projects: NuGet Package
  2. Add a text file named 'config.nsdepcop' to your project, then edit it to define your dependency rules.
  3. Dependency violations will be underlined in the code editor and reported at build time just like compiler errors/warnings.

See the Help for details.

Or check out this step-by-step tutorial video by plainionist.

Requirements

NsDepCop runs inside the C# compiler, so the build toolchain (Visual Studio / .NET SDK) determines compatibility, not the project's target framework:

NsDepCop Visual Studio .NET SDK Roslyn
3.0+ 2022 17.0+ 6.0+ 4.0+
2.7.x and earlier 2019 16.9+ 5.0+ 3.9+

Newer C# syntax is only analyzed when the toolchain's Roslyn supports it — e.g. C# 14 extension members need Roslyn 5+ (VS 2026 / .NET 10 SDK).

Versions

Feedback

More Info

Thanks to

License

Other Tools