NsDepCop - Namespace Dependency Checker Tool for C#
NsDepCop is a static code analysis tool that helps you to enforce namespace dependency rules in C# projects.
- Runs as part of the build process and reports dependency problems.
- No more unplanned or unnoticed dependencies in your system.
What is this dependency control anyway?
Getting Started
- Add the NsDepCop NuGet package to your C# projects:
- Add a file called config.nsdepcop. Edit it and describe dependency rules.
- For projects that use the old packages.config nuget format the file is automatically added.
- When you build the project, dependency violations will be reported in the build output just like compiler errors/warnings.
See the Help for details.
Optional Stuff
-
Install the VSIX (Visual Studio Extension) to get instant dependency check while editing the code.
-
Install the NsDepCop Config XML Schema Support for Visual Studio to get validation and IntelliSense while editing the config.nsdepcop files.
- For Visual Studio 2017/2019:
- For Visual Studio 2015: see the instructions in Help.
Versions
- See the Change Log for version history.
- See the Upgrade instructions if upgrading from versions prior to v1.6.0.
- See the Milestones for planned releases.
Feedback
- Please use the Issue Tracker to record bugs and feature requests.
- Or find me on twitter
More Info
Thanks to
- Roslyn for the best parser API.
- ReSharper for the free licence of this amazing tool.
- DotNet.Glob for the globbing library.