Adding FxCopCmd to Your Build Process

For ongoing development projects, you can automate the task of analyzing your assemblies. By using the following procedure, you can customize your build system so that a saved project runs every time that your assemblies are built.

Procedures

To analyze assemblies as part of the build process

  1. Use a build script to build your managed assemblies.

  2. In your build script, call FxCopCmd to analyze your assemblies.

  3. Review the analysis report output from step 2.

  4. If new messages must be excluded, or other changes to the project are required, use the FxCop application to update your project and save your changes.

  5. Correct any code defects that are detected by FxCopCmd.

If you are not using a project file to specify information to FxCopCmd with the /project option, you must supply an assembly using the /file option, and a rules directory using the /rules option. In either case, you must also specify the location of the output file that uses the /out option. For more information, see Command-Line Tool Options.