#223 – Enabling Code Analysis for Your Project

If you’re using Visual Studio 2010, the Ultimate and Premium versions come with a built-in code analysis tool, which allows you to check your code for potential problems.  Code analysis will check your code at the time that you build it, looking for logic errors or common mistakes.

To turn code analysis on at build-time, do the following.  Right-click your project in the Solution Explorer and select Properties.

Click on the Code Analysis tab.

Check the box labeled Enable Code Analysis on Build.

The next time that you build your project, the code analysis tool will check it for the problems covered by the Microsoft Basic Correctness Rules rule set.  Any problems found will be reported as Warnings in the Error List window.

Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

3 Responses to #223 – Enabling Code Analysis for Your Project

  1. tribalthirst says:

    Good areticle Sean. Code Analysis is such an unused feature I believe, but such a necessary one. I have been writing recently about the benefits of code analysis and would appreciate your comments. http://tribalthirst.com

  2. Pingback: Tweets that mention #223 – Enabling Code Analysis for Your Project « 2,000 Things You Should Know About C# -- Topsy.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: