0

I have found that there are more findings generated when running FxCop against release build than debug build. Anybody experienced the same issue?

Jin
  • 1

1 Answers1

1

Compiler optimizations can lead to differences in FxCop rule behaviour, although the rules that ship with FxCop are usually pretty robust with respect to this. Are the differences you are seeing in custom rules? If not, do you have the CODE_ANALYSIS compilation flag enabled for your release build? If so, what rule(s) are generating problems only in release mode?

Nicole Calinoiu
  • 20,843
  • 2
  • 44
  • 49
  • Thanks Nicole! I don't have CODE_ANALYSIS compilation flag enabled for my release build, and I don't have custom rules, I only use standard rules shipped with FxCop. – Jin May 23 '12 at 13:07
  • If you don't include the CODE_ANALYSIS compilation flag, your SuppressMessage attributes will not be included in the compiled code, so they won't be visible to FxCop. If you want them to be considered, you have to add the compilation flag. – Nicole Calinoiu May 23 '12 at 13:15
  • We actually did not use SuppressMessage attributes in our code for the time being, not even in debug build. We just excluded bunch of existing findings from one point, and tried to resolve any new active issue coming up. – Jin May 23 '12 at 19:40