When I started developing my module, I had an interface IParamCountBasedAlgo declared as a nested type in a class AlgorithmOneExecutor , declared as follows:- namespace DataStructuresAndAlgo { partial class AlgorithmOneExecutor { private interface IParamCountBasedAlgo { void Validate(); void Execute(); } } } There were other concrete nested types inside AlgorithmOneExecutor that implemented IParamCountBasedAlgo . But later, other types nested in other than AlgorithmOneExecutor emerged that required to implement IParamCountBasedAlgo . So I moved IParamCountBasedAlgo from a nested type to a direct type under the namespace DataStructuresAndAlgo , as declared below:- namespace DataStructuresAndAlgo { private interface IParamCountBasedAlgo { void Validate(); void Execute(); } } And the compiler spat an error " Namespace elements cannot be explicitly declared as private, protected, or protected internal ". Then a simple resear...
Another effective [debugging] technique is to explain your code to someone else. This will often cause you to explain the bug to yourself. Sometimes it takes no more than a few sentences, followed by an embarrassed "Never mind. I see what's wrong. Sorry to bother you." This works remarkbly well; you can even use non-programmers as listeners. - From "The Practice of Programming" by Brian W Kernighan & Rob Pike.