Quick Start Guide to FxCopCmd

This document provides a brief overview of FxCopCmd, which is the command-line companion to the FxCop application. For a complete description of FxCopCmd, see Using FxCopCmd.

FxCopCmd is useful for analyzing assemblies in an automated environment but it does not support creating or configuring projects, or excluding messages. Although individual types and rules can be directly specified with the command-line options, the FxCop application provides easier and more finely detailed control.

Command-line options are used to specify the assemblies to be analyzed, the rules used to analyze the assemblies, and the location of the output file.

To specify the assemblies and rules, use one of the following:

  • The /project option, which uses a project saved from the FxCop application.

  • The /file and /rule options, which directly specify the assemblies and rules, respectively.

To specify the location of the output file, use one of the following:

  • The /out option, which saves the results of an analysis in an XML file.

  • The /console option, which displays the results in a console window or, if integrated with Visual Studio, in the Output window.

The following examples illustrate a minimum command line:

  • FxCopCmd /p:SomeProject.FxCop /c

  • FxCopCmd /f:SomeAssembly.dll /r:"C:\Rules Directory\SomeRules.dll" /o:OutputFile.xml

    NoteNote

    Option values that contain spaces must be enclosed in double quotation marks and most options can be specified by using only the first letter of the option.