Share via


How to: Enable and Disable Automatic Code Analysis for C/C++

You can configure code analysis to run with each build of a managed code project. You can set different code analysis properties for each configuration and target platform. If your code project contains managed C++, you can also run the managed code analysis rules. For more information, see Analyzing Managed Code Quality by Using Code Analysis.

To enable or disable automatic code analysis

  1. In Solution Explorer, right-click the project, and then click Properties.

  2. In the properties dialog box for the project, click Code Analysis.

  3. Specify the build type in Configuration and the target platform in Platform.

  4. To enable or disable automatic code analysis, select or clear the Enable Code Analysis for C/C++ on Build check box.

  5. To enable or disable automatic code analysis for managed code, select or clear the Enable Code Analysis on Build (defines CODE_ANALYSIS constant) check box.

  6. If you enable code analysis for managed code, you can choose the collection of rules to use from the Run this rule set list.

See Also

Tasks

How to: Run Code Analysis Manually on C/C++ Projects

Concepts

Analyzing Managed Code Quality by Using Code Analysis