Free cookie consent management tool by TermsFeed Policy Generator

Changes between Initial Version and Version 3 of Ticket #1759


Ignore:
Timestamp:
01/17/12 11:08:55 (12 years ago)
Author:
abeham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1759

    • Property Owner changed from swagner to abeham
    • Property Status changed from new to accepted
  • Ticket #1759 – Description

    initial v3  
     1There's a tutorial on the [http://blogs.msdn.com/b/codeanalysis/archive/2010/03/26/how-to-write-custom-static-code-analysis-rules-and-integrate-them-into-visual-studio-2010.aspx codeanalysis blog] on how to write custom rules. They note that writing custom rules is not a supported feature. However, implementing a rule doesn't seem to be that complicated (depends of course) and we might benefit a lot from having the most important rules manifested and automatically tested.
     2
     3The integration into the build seems quite easy. First, the rules are written as classes deriving from `BaseIntrospectionRule` in an assembly. The assembly has to be placed into a convenient location in the repository. The assembly also contains an additional xml file that provides metadata on these rules. Having this, a custom ruleset needs to be created in the solution folder. This ruleset references the rules in the assembly and defines whether a certain rule is a warning or error. Finally, the ruleset can be selected in the project properties in the tab "Code Analysis" and have it checked on build. Manual integration should also be possible easily as !FxCop is essentially a command line program.
     4
     5Official documentation on !FxCop is hardly available, but there is a good [http://www.binarycoder.net/fxcop/pdf/fxcop.pdf summary] (PDF) available from another party.