In the build definition of TFS 2010, when “Perform Code Analysis” set to “Always” how can I specify a custom code analysis rules file?
The build flavour is “Release”.
I prefer not to set “AsConfigured” for “Perform Code Analysis” so that the settings are picked from proj file.
Thanks.
You should be able to use the “MSBuild Arguments” entry in your build process parameters configuration to provide a
/propertycommand line entry that will be passed to MSBuild, thereby allowing override of theCodeAnalysisRuleSetproperty value to be applied.Depending on how you have set up the CodeAnalysisRuleSet property values in your existing projects, you may also need to tweak the value assignments to be conditional on the pre-existing value being empty. If you need to do this, you might want to consider taking the opportunity to move the code analysis configuration for all projects into a separate .targets file so that they can be tweaked more easily in the future.