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
In Solution Explorer, right-click the project, and then click Properties.
In the properties dialog box for the project, click Code Analysis.
Specify the build type in Configuration and the target platform in Platform.
To enable or disable automatic code analysis, select or clear the Enable Code Analysis for C/C++ on Build check box.
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.
If you enable code analysis for managed code, you can choose the collection of rules to use from the Run this rule set list.