Share via

Using Rule Sets to Group Code Analysis Rules


This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

When you configure code analysis in Visual Studio Ultimate, Visual Studio Premium, or Visual Studio Professional, you can choose from a list of Microsoft built-in rule sets. A rule set is a logical grouping of code analysis rules that identify targeted issues and specific conditions. For example, you can apply a rule set that is designed to scan code for publicly available APIs, or you can apply a rule set that includes only the minimum recommended rules. You can also apply a rule set that includes all the rules.

You can customize a rule set by adding or deleting rules, or by changing rules to appear in the Error List window as either warnings or errors. Customized rule sets can fulfill a need for your particular development environment. When you customize a rule set, the rule set page provides search and filtering tools to help you in the process.

Common Tasks

Task Related Content
Get hands-on practice: Use the code analysis tools to specify a custom rule set to find and fix issues in a simple .NET Framework application. - Walkthrough: Configuring and Using a Custom Rule Set
Configure code analysis for a project: Choose an existing rule set for a project, Web site, or solution. - How to: Configure Code Analysis for a Managed Code Project
- Using Rule Sets to Specify the C++ Rules to Run
- How to: Configure Code Analysis for an ASP.NET Web Application
- How to: Specify Rule Sets for Multiple Projects in a Solution
Customize a rule set: Specify rules to apply to your project. - Creating Custom Rule Sets
Understand the built-in rule sets: View the code analysis rules that make up the built-in rule sets. - Code analysis rule set reference
Integrate code analysis with Team Foundation Server: Team Foundation Server check-in policies enable development teams to make sure that all code check-ins meet a common set of code analysis standards. - How to: Synchronize Code Project Rule Sets with Team Project Check-in Policy