views:

139

answers:

3

I once remember seeing an addon or something for VS2008. It was provided by Microsoft and was part of best practices. Basically each time the project builds it checks your code to make sure all properties have comments, etc.

Please could someone help me remember what it was called?

+1  A: 

Was it FxCop?

"FxCop is an application that analyzes managed code assemblies (code that targets the .NET Framework common language runtime) and reports information about the assemblies, such as possible design, localization, performance, and security improvements."

RichieHindle
+8  A: 

FxCop (new homepage) & StyleCop

FxCop: Provides static assembly analysis.
StyleCop: Provides source code analysis.

Both can be integrated into visual studio by editing your .csproj files you include tasks to run the analysis.

FxCop:
Can be integrated by calling the command line FxCopCmd tool from a post build event. Add something like this to your .csproj file. We include a common custom dictionary with our analysis too. You can miss that out if you don't 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 the StyleCop targets
  <Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\Microsoft.StyleCop.targets" />

(FxCop is built into VS2008 team edition now, it's called "code analysis")

[Edit: FxCop has a new home now and the latest version (1.36) can be downloaded here. there is also talk of it being built into vs2010, but no mention of which level you will have to have to get it.]

Simon P Stevens
Yep, sounds like StyleCop.
DeletedAccount
Thanks a lot Simon and everyone else who remembered :) Looks like StyleCop is still in development :)
JL
No problem. Yes, StyleCop is still in development, but it's working well as it is. As with many tools like this I suspect it will be pretty much in permanent development as it's refined and improved.
Simon P Stevens
+1 for mentioning both FxCop *and* StyleCop as well as providing the corresponding MSBuild snippets. Thank you!
SealedSun
+1  A: 

Are you thinking of StyleCop?

Simon Temlett