Welcome to MSDN Blogs Sign in | Join | Help

$(CodeAnalysisTreatWarningsAsErrors) MSBuild property

For Visual Studio 2008, we have added a new MSBuild property that allows you to easily treat all Code Analysis warnings as build errors. This can be useful for example, if you want to force that any firing of a Code Analysis rule to break the build during a nightly Team Build without needing to individually set this for every rule.

To use, simply add the <CodeAnalysisTreatWarningsAsErrors> property to your project file (or a common targets file) and set it to true:

CodeAnalysisTreatWarningsAsErrors MSBuild property

Now, in the next run of Code Analysis, all rules will be displayed as errors:

Error List with Code Analysis errors

Published Wednesday, August 08, 2007 8:00 AM by David M. Kean

Comments

Wednesday, August 08, 2007 5:18 PM by Chris Conti

# re: $(CodeAnalysisTreatWarningAsErrors) MSBuild property

In VS2008, is integrated code analysis still relegated to the Team editions of VS? FxCop? /analyze (C++)? (If I ever get a free moment, I'll actually install Beta 2 and check for myself...)

I've always failed to understand the tying to the Team editions as both FxCop and PREFast are freely available (The Vista SDK includes a C++ compiler with /analyze enabled).

Friday, November 23, 2007 5:22 AM by From the software development trenches

# FxCop

In previous posts about Code Metrics and Code Reviews , I explored some metrics and techniques that I

New Comments to this post are disabled
 
Page view tracker