The code analysis feature for managed code checks assemblies for conformance to the Microsoft .NET Framework Design Guidelines.
Select a project in Solution Explorer.
On the Project menu, click <project name> Properties.
Click Code Analysis.
Select Enable Code Analysis on Build (defines CODE_ANALYSIS constant).