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!

Posted in Programming Tagged with: , ,

Leave a Reply

About Thomas

My name is Thomas Hjorth Biilmann. I'm a pragmatic, humorous, floorball-playing computer programmer living in Denmark, along with 5,5 million other shiny happy people.
I work for DanPilot - Denmark's largest maritime pilotage service provider - where I design and implement systems that are at the very core of the business.
I am also the father of three little princesses - because that is what real Kings produce.
Subscribe via RSS