I want to be able to specify the Code AnalysisRules in commandline MSBuild (for Code Analysis / FXCOP). The project file would have something like this in it:
<CodeAnalysisRules>-Microsoft.Globalization#CA1301;-Microsoft.Globalization#CA1302</CodeAnalysisRules>
So I would assume that I use something like this:
MSBuild.exe /property:RunCodeAnalysis=true /property:CodeAnalysisRules=-Microsoft.Globalization#CA1301
Which works fine, but when I want to add another rule, it does not like the semi colon:
MSBuild.exe /property:RunCodeAnalysis=true /property:CodeAnalysisRules=-Microsoft.Globalization#CA1301;-Microsoft.Globalization#CA1302
MSBUILD : error MSB1006: Property is not valid. Switch: -Microsoft.Globalization#CA1302
How can I specify more than one rule?
I am happy to reference a file, but I don't want to just change the project files.
Backgroud: I want to create a set of rules for a continuous integration server (Hudson in my case).
Note: I am running Visual Studio 2005
Try this:
msbuild /property:RunCodeAnalysis=true;CodeAnalysisRules=-Microsoft.Globalizati
on#CA1301%3B-Microsoft.Globalization#CA1302
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With