Custom rules limitations

We are beginning to implement FXCop, and are looking to use several custom rules.  I've noticed limitations on certain rule testing.  Are the following possible to implement as custom rules

Use brackets after if statements
object assignments should occur in Try blocks


Answer this question

Custom rules limitations

  • Ricardo RWS

    We're looking for verification that some exception handling is present should object assignment fail.
  • Ryn

    James' answer is on the mark.

    What are you trying to enforce w/your object assignment rule We should probably try to get a rule sample out there that shows how to work w/the current exception handling representation.

    Michael Fanning



  • MikeCampbell

    Use brackets after if statements: No, FxCop looks at the MSIL, not the source code.
    Object assignments should occue in Try blocks: Yes, but torturous.

  • Custom rules limitations