Take the 2-minute tour ×

Is there a tool that can run through a visual studio solution and adjust access modifiers to anything not being called in the solution is converted to private or internal where applicable?

I suppose I could just change everything to private, and then use the compiler messages and do it by hand...but that could take a while, if there was something automatic, that would be fantastic!

share|improve this question
Are there any free tools? –  Arithmomaniac Jul 12 '12 at 18:09

1 Answer 1

up vote 2 down vote accepted

With NDepend you can analyze your code for stuff like this. It has a SQL-like query language where you can select all the members that are public and could be internal or private, like this:


EDIT: See this blog post about Optimal Encapsulation.

share|improve this answer

Your Answer


