How to: Run Code Analysis

The code analysis tool provides information to you about possible defects in your source code.

To run code analysis by using the Project menu

  1. On the Project menu, click <project name> Properties, and then select Code Analysis tab.

  2. Select Enable Code Analysis on Build (defines CODE_ANALYSIS constant).

To run code analysis by using the Build or the Analyze menus

  • On either the Build or the Analyze menu, click Run Code Analysis on <project name>.

To run code analysis from Solution Explorer

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

  2. Select the Code Analysis tab, and then select Enable Code Analysis on Build (defines CODE_ANALYSIS constant).

See Also

Other Resources

Detecting and Correcting C/C++ Code Defects

Detecting and Correcting Managed Code Defects