FxCop integration in Visual Studio 2005

Static analysis catches entire categories of bugs before the compiler ever sees your code. Microsoft knew this—which is why they buried full FxCop integration inside Visual Studio Team Edition and left Professional developers to fend for themselves. There are three ways to close that gap.

The open-source add-in

The simplest route is an open-source add-in hosted on tigris.org. It wires FxCop directly into the VS 2005 shell, giving you menu entries and output-window integration without touching the registry. For most teams, this is enough.

Configuring an external tool

If you’d rather not install an add-in, you can register FxCop as an external tool under Tools → External Tools. Point the command at your FxCop executable, pass the project file as an argument, and redirect output to the VS Output window. It’s not seamless, but it keeps analysis in your workflow without leaving the IDE.

The registry approach—almost the holy grail

The most complete solution involves copying two directories from a Visual Studio Team Edition installation and merging a handful of registry entries. Specifically, you need the MSBuild CodeAnalysis folder and the Static Analysis Tools directory. Once the registry keys are in place, Professional edition behaves as if Team Edition’s code analysis feature were always there.

This is, as I put it at the time, almost the holy grail of static analysis for Professional edition users. The qualifier matters: Microsoft neither supports nor sanctions this approach, and there are redistributable concerns with copying those binaries. Use it in full awareness of what you’re doing.

The .reg template for the merge looks roughly like this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\{...}]
"CodeAnalysis"="1"

The exact keys depend on your VS installation path—verify them against a Team Edition machine before applying.

Which to choose

The add-in is the right answer for most Professional edition shops. The external-tool approach works well in CI contexts where you want FxCop output alongside build output. The registry path is worth knowing exists, but treat it as a last resort rather than a default.

Whatever route you pick, the point is that “we don’t have Team Edition” is no longer a reason to skip static analysis. The tools are there.