This documentation is archived and is not being maintained.

Creating and Using Code Analysis Check-In Policies

When you use Visual Studio Premium, you can create a code analysis check-in policy for the .NET Framework and native (C/C++) code projects in a team project. You can use the code analysis check-in policy to control and improve the quality of code that is checked into the code base.

The policy passes when the local build is up to date and code analysis has been run on the most recent source files. At a minimum, the code analysis rules that are enabled in the code project must contain the same rules as those that are defined in the team project check-in policy. Rules that have been specified as errors in the Team Project Settings must also be specified as errors in the code project

Important note Important

To use check-in policies, you must be connected to Visual Studio Team Foundation Server.

You create code analysis check-in policies by using the Team Project Settings of Team Foundation version control. Check-in policies are specified and enforced for a team project, but code analysis runs are configured and run for individual code projects on local development computers. This section describes how to specify code analysis check-in policies for a team project and how to implement custom code analysis policies for managed code.

How to: Create or Update Standard Code Analysis Check-in Policies

Explains the steps that you use to set and modify a code analysis policy for a team project.

Implementing Custom Code Analysis Check-in Policies for Managed Code

Explains the steps that you use to create a custom rule set for the check-in policy of a team project, and to synchronize the code projects of the team project with the check-in policy.

Version Compatibility for Code Analysis Check-In Policies

Explains code analysis check-in compatibility issues between versions of Visual Studio Application Lifecycle Management (ALM).

How to: Customize the Code Analysis Dictionary

Explains how to add words and tokens to the dictionary that is referenced in code analysis naming rules.