FxCopCmd Error Codes

.NET Framework 2.0

Errors can occur while you are loading items into FxCopCmd for analysis, or during the analysis itself. FxCopCmd does not consider all errors to be fatal. If, despite errors, FxCopCmd has sufficient information to perform a partial analysis, it performs the analysis and reports the errors that occurred. Error messages are sent to the console's error stream, and informational messages about the progress of the analysis are sent to the console's output stream.

In addition to outputting error messages, FxCopCmd returns an error code. The error code is a 32-bit integer that contains a bitwise combination of numeric values that correspond to errors. The following table describes the error code values that are returned by FxCopCmd.

Error Numeric value

No errors


Analysis error

0x1 - fatal error

Rule exceptions


Project load error


Assembly load error


Rule library load error


Import report load error


Output error


Command line switch error


Initialization error


Assembly references error


Unknown error


The "Analysis error" (bit 1) is set in the returned value if any errors were fatal. This means that analysis could not finish. When applicable, the error code also contains the underlying cause of the fatal error. The following are some of the conditions that are considered fatal errors:

  • The analysis could not be performed because of insufficient input.

  • The analysis threw an exception that is not handled by FxCopCmd.

  • The specified project file could not be found or is corrupted.

  • The output option was not specified or the file could not be written.

Community Additions