Search code examples
asp.netfxcopgendarme

Gendarme vs FxCop


Gendarme and FxCop look very similar and seem to tackle the same problem. Which would you suggest for a small team of developers (3-5) mainly working on web application with lots of business logic? Why?


Solution

  • Gendarme is indeed the Mono equivalent of FxCop. Given that Microsoft is planning to ship a considerable set of Code Analysis rules with most versions of the next Visual Studio, you might want to use FxCop and stick with that. The integrated version of FxCop (called Code Analysis) is the simplest to use if your Visual Studio version supports it (Visual Studio 2010 Premium and Ultimate).

    Heading

    There is a Visual Studio add-in which allows you to run FxCop from inside Visual Studio Professional as well. You need to download FxCop 10 separately (it's part of the Windows Platform SDK). Do note that the Visual Studio integrated version comes with a few additional rules, so the output may differ.

    As Gendarme doesn't integrate directly into Visual Studio (though you can make it part of the build process) and you won't see many people using Visual Studio use Gendarme. Mostly because it isn't too well known.

    In the end I'd use FxCop from a convenience perspective. It's integrated into the version of Visual Studio I use by default and it's well known in the developer community.

    But if you're not using Visual Studio Premium or Ultimate, then you can pick either or even both. Just keep in mind that if you choose both, you'll probably be receiving a number of duplicate messages or even conflicting messages as the creators of these different tools don't always agree.

    If you don't mind investing some money, then, as g45rg34d suggests, Resharper or Coderush are very useful additions (I wouldn't call them replacements, as they don't run outside of the IDE (in the continuous integration build for example)) as they provide direct feedback as you're writing the code. Often even without having to compile it. And they often provide the ability to "apply the fix" without you having to figure out exactly what to do.