Which are the "must follow" FxCop rules for any C# developer?

Vijesh VP picture Vijesh VP · Sep 27, 2008 · Viewed 10.4k times · Source

I'm planning to start using FxCop in one of our ongoing project. But, when i tried it with selecting all available rules, it looks like I have to make lots of changes in my code. Being a "team member" I can't right away start making these changes, like naming convention change etc. anyway i would like to start using FxCop with a minimal rule set and would gradually increase the rule set as we goes on. Can you suggest me some must have FxCop rules which i should start following. Or do you suggest any better approach?

Note: Most of my code is in C#.

Answer

Sklivvz picture Sklivvz · Sep 27, 2008

On our most important code:

  • Treat warnings as errors (level 4)
  • FxCop must pass 100% (no ignores generally allowed)
  • Gendarme used as a guideline (sometimes it conflicts with FxCop)

Believe it or not, FxCop teaches you a hell of a lot on how to write better code... great tool! So for us, all rules are equally important.