Integrating FxCop and StyleCop into TFS 2010/VS continuous integration process
Domanda
I'm setting up a continuous build process on Jenkins, TeamCity and TFS 2010 to compare them. In Jenkins and TeamCity I'm building the project on every check-in, and I've set up FxCop and StyleCop analysis and reporting. Now I want to do this in TFS 2010.
If I want to make sure FxCop (or Visual Studio Code Analysis) and StyleCop is being run on every check-in, how do I do that with TFS 2010/VS? I'm also wondering if there are several ways of doing it (Continuous integration vs gated check-in)?
Soluzione
There's a few different ways to run these as part of the build. For FxCop you can set the PerformCodeAnalysis property on the TFS Build Definition. Personally I prefer to pass in the following values using the MSBuildArguments property on the Build Definition:
/p:RunCodeAnalysis=True /p:CodeAnalysisRuleSet="..\Foo.ruleset
For StyleCop I use the custom activity from the Community TFS Build Extensions project. You can find the binaries and instructions here: StyleCop Custom Activity