After upgrading to VS 2010, MSBUILD / p: RunCodeAnalysis = true does not work properly
msbuild solution.sln /p:RunCodeAnalysis=true
To get faster builds, we removed the CODE_ANALYSIS constant for the DEBUG assembly. But this means that when you run the above msbuild command, it deactivates all the rules, instead of using the set of rules specified on the Code Analysis tab on the project properties page.
So now I need to create a release mode to run the code analysis (which has the constant CODE_ANALYSIS):
msbuild solution.sln /p:RunCodeAnalysis=true /p:Configuration=release
This, however, means that we are getting a release build on our dev machines. And this has some side effects in our setup.
Question: How to indicate correctness from the command line. I was hoping for something like:
msbuild solution.sln /p:RunCodeAnalysis=true /p:foobar=rules.ruleset