Am trying to configure the static code analysis(FxCop) in my Continuous integration system.But my developers are using a rule set file for static analysis with Visual Studio.
Is there a way that i can re-use the same rule-set file and convert it into a FxCop rule-set dll and perform the static code analysis while build?
Thanks in advance, Ravi
If you have Visual Studio installed on the CI server, then simply specifying
/p:RunCodeAnalysis=[True|False|Always|Default|Never]
on the MsBuild command line should run Code Analysis as it was configured on the developer's configuration. The rules files are automatically included in the Visual Studio project file, so they should resolve on their own.To run FxCop after the build you can specify the ruleset as a commandline parameter:
The difficult part of running FxCop from the commandline is that you will want to pass all references and that it can only process files targeting the same .NET system libraries (it can only hold one of those in memory). You can specify these references using the following parameters: