How to integrate FxCop to Visual Studio 2010 Professional

VS 2010 Professional doesn’t support Static code analysis. Here is a simple way to integrate FxCop to Visual Studio. (It was also using External tools option from Visual Studio tools menu.)

  1. In the Title text box, type FxCop.
  2. Integrate FxCop to Visual Studio

    Integrate FxCop to Visual Studio

    .

  3. To set the value of the Command text box, browse to the location where FxCop is installed, and select FxCopCmd.exe.
  4. In the arguments text box, type the following command : /c /f:$(TargetPath) /d:$(BinDir) – More information : FxCop command line reference
  5. Set the Initial Directory to the location where FxCopCmd should start.
  6. Select the Use Output window check box. – This will display the output of FxCopcmd.exe to output window, and you can double click and navigate to the line number.
  7. FxCop - Source code analysis results in VS output window

    FxCop - Source code analysis results in VS output window

  8. Click OK.

Happy static code analysis :)