I'm implementing StyleCop in a .NET project that started 2 years ago and that had no code conventions, no static analysis.
After configuring the rules I want to use in StyleCop and ran it I got several thousands of warnings (I will omit the actual number because it would overflow the StackOverflow site :)).
The point is: since I cannot fix all the warnings in a moment, I want to setup some kind of "thresold" to avoid more violations, and I want to implement it as a post action build in MSBuild.
Now, the question is: is it possible to get the number of warnings in MSBuild and generate an Error Task if that number is bigger than some limit?
The mechanism must be available both in MSBuild and VisualStudio, since the IDE is the most common tool developers use in their daily work (that's why I don't want to write a script that takes MSBuild output, parse it and raise an error if the warning limit is reached).
Am I solving the wrong problem or facing the problem wrongly in your opinion? Have you ever faced some situation like this?