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.
To analyze assemblies as part of the build process
Use a build script to build your managed assemblies.
In your build script, call FxCopCmd to analyze your assemblies.
Review the analysis report output from step 2.
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.
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.