How to customize FxCopCmd behavior

FxCop Integrator supports to customize FxCopCmd behavior. For example, you can choose whether FxCopCmd ignores generated code or not.

Procedure

  • Step 1
Right click on the solution/project and select [Context Menu] > [Edit Code Analysis Configuration].
EditCodeAnalysisConfiguration.png
  • Step 2
Check Override '...' which you want to edit, and change Value.
CodeAnalysisConfigurationEditor.png
  • Step 3
Click [Save] button to save option values and to close window.

About Each Option

  • Enable Code Analysis
Whether or not to analyze your code. This option allow you to disable code analysis against specific projects (e.g. unit test projects).
  • Search Global Assembly Cache for missing references
Whether or not to search GAC for missing reference assemblies.
  • Suppress analysis results against generated code
Whether or not to analyze generated code.
  • Timeout for analysis deadlock detection
Timeout for analysis deadlock detection. Analysis will be aborted when analysis of a single item by a single rule exceeds the specified amount of time. Specify a value of 0 to disable deadlock detection.
  • Analyze code with RuleSet
RuleSet to enable/disable rules. FxCop Integrator passes the selected RuleSet to FxCopCmd when you execute code analysis. If you want to use custom RuleSet, click {[Browse]} button and select your custom RuleSet. Note that this option is ignored if you use FxCop 1.36, because FxCop 1.36 doesn't support RuleSet.
  • Enable code analysis on build
Whether or not to analyze your code automatically when you build it.

Solution Configuration and Project Configuration

FxCop Integrator supports Solution Configuration and Project Configuration.
  • Solution Configuration is used to customize FxCopCmd behavior for all projects in the solution. For example, if you set RuleSet option to "Microsoft Minimum Recommended Rules" in Solution Configuration, FxCop Integrator use the specified RuleSet to analyze each project, even if you analyze a specific project only.
  • Project Configuration is a setting for a specific project. The principal use of it is to override option values of Solution Configuration.

Each configuration file is located to following.

Name File
Solution Configuration $(SolutionDir)\CodeAnalysis\CodeAnalysisConfiguration.xml
Project Configuration $(ProjectDir)\CodeAnalysis\CodeAnalysisConfiguration.xml


StoredConfigurations.png

Last edited Jun 19, 2011 at 5:13 AM by sasaminn, version 12

Comments

No comments yet.