fxcop command line example


I noticed someone hit my site from a google search on
this topic.  My guess is they didn’t find out what they needed, so I
thought i’d post a complete answer just in case someone else comes looking for
it..


From Michael Fanning  the Dev lead for FxCop…


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">To invoke and run a
project file from the command-line:


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">FxCopCmd.exe
/project:MyProject.fxcop /out:MyReport.xml


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">To build up an analysis
run specifying specific files:


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">FxCopCmd.exe
/file:MyAssembly.dll /rules:.\Rules /out:MyReport.xml


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">The file: switch can
appear multiple times on a command-line. All switches can be abbreviated to
their first letter, p instead of project, etc.