8
votes

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)?

1

1 Answers

8
votes

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