I would like to force all my team members to perform a code analysis on their C# source code before committing it to the TFS. In this analysis, I would like to have code quality (style and possible errors).
I’ve found CodeRush, ReSharper, but they are very expensive.
I’ve also found FXCop, but it is only for DLL and EXE files.
I’ve fuond StyleCop, but I couldn’t find a way to integrate it to TFS and there is no “severity” in the warning messages.
Do you know any tools that have this kind of feature?
Thanks!
Assuming you can ensure all projects have the correct Code Analysis Ruleset configured for your organisation, you can set the Build Definition to “Perform Code Analysis” to “Always”.
You can add support for StyleCop in you Build Process Template. Have a look at TFS Build Extensions for more information.
Also, In TFS 2010+ you can use gated checkins (as Bob says) to prevent devs from ever breaking your build.