How to use a single ruleset file for all projects in a solution

  • Step 1
Create the 'CodeAnalysis' folder in the solution root folder. The solution root folder is a folder that stores *.sln file.
create_code_analysis_folder.png
  • Step 2
Copy a ruletset file to the 'CodeAnalysis' folder that is created by Step 1.
copy_custom_ruleset.png
  • Step 3
Open a solution file with VS2010.
  • Step 4
Open the context menu of a solution and select the [Edit Code Analysis Configuration] menu.
edit_solution_configuration.png
  • Step 5
Select the custom ruleset in the 'Analyze code with Ruleset' combo box.
select_custom_ruleset.png
  • Step 6
Click [Save] button.
save_solution_configuration.png
  • Step 7
Open the context menu of a solution or a project and select the Code Analysis with FxCop menu.

Note that you have to uncheck 'Override Analyze code with Ruleset' of the code analysis configuration of each project. If this option is checked, FxCop Integrator overrides ruleset setting of the solution configuration.
project_configuration.png

Last edited Nov 8, 2011 at 10:38 PM by sasaminn, version 3

Comments

No comments yet.