SonarQube, TeamCity and FxCop integration

As an update to my previous post, I would like to add a few important points re. using FxCop from within SonarQube.

First, it is tricky to get up and running. I ran into all the difficulties described here.

In short, to get FxCop analysis results in SonarQube, from a build triggered in TeamCity, do the following:

  1. Install FxCop. That is done by first downloading and installing the Windows 7 SDK.
  2. If the SDK installer fails, check if you have the situation described here. (Basically: Do you have the C++ redists installed? If so, uninstall both temporarily, then reinstall them afterwards).
  3. Once you finally have the SDK installed, install FxCop by running the [SDKpath]/bin/FxCop/FxCopSetup.exe file. (Oh, yes – an installer that installs an installer. Nice.)
  4. Enter the path to FxCopCmd.exe on the SonarQube project settings > C# > Code Analysis/FxCop page:

sonarqube settings

And now, after a succesful build from TeamCity you should – finally – begin to see FxCop results in SonarQube!

Tagged with: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *