Preventing multiple reporting of the same rule violation in FxCop -- What is Id?

Posted by Dave on Stack Overflow See other posts from Stack Overflow or by Dave
Published on 2010-03-29T21:57:44Z Indexed on 2010/03/29 22:03 UTC
Read the original article Hit count: 337

Filed under:
|
|
|
|

FxCop is currently reporting the same rule violation for a particular method -- it has two out parameters, because I want to return two values to the caller without creating a struct for it. I wonder if anonymous types would solve my problem, but I didn't know about them at the time I had written the method.

Anyhow, I'm getting CheckId CA1021 reported once for each parameter. I've copied the SuppressMessage text from FxCop, and then realized that the Id for each message is different! To me, it seems like you only need the CheckId, so...

  1. what is the Id used for? I haven't been able to find information about it online.
  2. will the Id remain the same? I assume so, or SuppressMessage wouldn't work the way one would want it to
  3. is there a way to specify the SuppressMessage attribute so that it suppresses for all Ids?

© Stack Overflow or respective owner

Related posts about fxcop

Related posts about suppressmessage