FxCop ( new page ) and StyleCop
FxCop . Provides static precast analysis.
StyleCop . Provides source code analysis.
Both can be integrated into the visual studio by editing your .csproj files, which include tasks to run the analysis.
FxCop:
Can be integrated by calling the FxCopCmd command-line tool from the post build event. Add something like this to your .csproj file. We also include a common user dictionary with our analysis. You can skip this if you do not want it.
<PropertyGroup>
<PostBuildEvent> "% 25ProgramFiles% 25 / Microsoft FxCop / FxCopCmd.exe" / file: "$ (TargetPath)" / searchgac / console /dictionary:"$(SolutionDir)....\Tools\FxCop\Config\CustomDictionary. xml "</PostBuildEvent>
</PropertyGroup>StyleCop:This is done by importing StyleCop targets <Import Project = "$ (ProgramFiles) \ MSBuild \ Microsoft \ StyleCop \ v4.3 \ Microsoft.StyleCop.targets" />
(FxCop is now integrated into the VS2008 team edition, it is called "code analysis")
[Edit: FxCop home, (1.36) . , vs2010, , .]