In my project\'s settings in Visual Studio, I have set \'Treat warnings as errors\' to \'All\'. The Warning level is set to 4. I tested this by deliberately introducing code
You could use the "CodeAnalysisTreatWarningsAsErrors" property in your csproj-file like described here:
http://blogs.msdn.com/b/codeanalysis/archive/2007/08/08/_24002800_codeanalysistreatwarningaserrors_2900_-msbuild-property.aspx
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 property to your project file (or a common targets file) and set it to true:
[...]
true
[...]
true
[...]
true
[...]
This can be used with in combination with
, which will have the same effect on StyleCop warnings.