1
votes

I am trying to analyze a C# project using Jenkins, FxCop, and SonarQube. Currently, the build steps I am using are "SonarQube Scanner for MSBuild - Begin Analysis", "FxCop exec.", "Build a Visual Studio Project or solution using MSBuild", and "SonarQube Scanner for MSBuild - End Analysis". Both FxCop and SonarQube are running perfectly, when they are run separately.

The error message I am receiving is the following:

"C:\Program Files (x86)\Jenkins\workspace\Sonarqube Test\Collette.sln" (default target) (1) -> "C:\Program Files (x86)\Jenkins\workspace\Sonarqube Test\web\Collette.Web\Collette.Web.csproj" (default target) (2) -> "C:\Program Files (x86)\Jenkins\workspace\Sonarqube Test\src\Collette.Crm\Collette.Crm.csproj" (default target) (3) -> (FailIfFxCopNotInstalled target) -> C:\Program Files (x86)\Jenkins\workspace\Sonarqube Test.sonarqube\bin\targets\SonarQube.Integration.targets(402,5): error : FxCop must be installed when some of its rules are enabled in the SonarQube quality profile. FxCop is included as part of Visual Studio. [C:\Program Files (x86)\Jenkins\workspace\Sonarqube Test\src\Collette.Crm\Collette.Crm.csproj]

Does anyone have any ideas as to what could be going on?

Thanks!

1

1 Answers

2
votes

You don't need to have a dedicated FxCop exec. build step. The SonarQube Scanner for MSBuild will configure MSBuild to run FxCop during the build, i.e. during the Build a Visual Studio Project or solution using MSBuild step.

Then, as stated in the error message, FxCop has to be installed so that you can run it. The easiest way is to install Visual Studio 2015 on your build machine and then build your project using this newly installed Visual Studio 2015.