This project is read-only.

New rule idea - Class name must not be the same as namespace name

Aug 17, 2012 at 7:58 AM

Code with violation:

namespace MyContainers.List
    public class List { … }

Explanation why this is bad -

Aug 17, 2012 at 5:37 PM

I agree that this would be nice to detect automatically with a tool.

However, this particular rule is better suited for a custom Code Analysis (FxCop) rule. StyleCop is designed for formatting concerns, not structural or naming issues that can be discovered using reflection/introspection.

I believe the Mono tool called "Gendarme" (think French for "cop") checks for this violation.

Aug 20, 2012 at 8:09 AM

Gendarme home page is at