Skip to content

Installing a Custom Rule

Christophe HEISER edited this page Aug 16, 2015 · 2 revisions

Custom StyleCop rules can be installed by simply copying the assembly containing the rules to the directory that contains StyleCop.dll, or any subdirectory under that directory. StyleCop will load the new assembly and discover the rules within the assembly automatically, provided that each rule inherits from the SourceAnalyzer class, contains an instance of the SourceAnalyzerAttribute attribute, and also contains a well-formatted Xml metadata document with the same name as the rule class.

To learn how to author a custom StyleCop rules analyzer, see the Writing Custom Rules for StyleCop topic.

Clone this wiki locally