While writing your custom rule, you will likely come across a need to debug it and work out why it's behaving in a particular manner.Debugging within FxCop
Debugging a custom rule within the FxCop UI is actually quite easy. To do so, simply:
The debugger should break when it hits the breakpoint.
Debugging within Visual Studio or via command-line
However, if you want debug a rule that you've written for Visual Studio Code Analysis, or via the command-line, the procedure is not so obvious:
> cd %VSINSTALLDIR%\Team Tools\Static Analysis Tools\FxCop
> cd %PROGRAMFILES%\Microsoft FxCop 1.35
> devenv /debugexe FxCopCmd.exe /file:[TargetAssembly] /rule:[RuleAssembly] /console
Choose File -> Open -> File and browse to and open the source file that contains your custom rule
Set a breakpoint in the rule
Choose Debug -> Start Debugging
The Modules window is your friend
If the breakpoint is not being hit, check to make sure that you actually have symbols for your custom rule loaded: