A while ago I mentioned that FxCop (and hence Managed Code Analysis) naming and design rules only fire on publicly visible types and members.
As you may recall, there were a couple of reason for this:
In that same post, I also showed how to override this behavior in in FxCop. Now, since then, I've been asked by a few readers on whether it was possible to do this within Visual Studio 2005, unfortunately, the answer up until now was no.
However, the good news is that in the newly released Visual Studio 'Orcas' Beta 1, we sneaked in a small feature in that allows you to override this on a per-project basis.
To turn it on, simply do the following:
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <CodeAnalysisOverrideRuleVisibilities>true</CodeAnalysisOverrideRuleVisibilities> [..] </PropertyGroup> </Project>
The naming and design rules (such as IdentifiersShouldBeCasedCorrectly and IdentifiersShouldBeSpelledCorrectly) will now run against all types and members, not just those visible outside of the assembly.
If you want to enable this for all your projects, see the following: FAQ: How do I share Managed Code Analysis rule settings over multiple projects?.