0
votes

We are using Visual Studio 2015 (original release, no update) with SonarQube and Jenkins, and keep getting the message:

WARN - * The use of MSBuild 12 or the sonar-runner to analyze C# projects is DEPRECATED *

However, we are using MSBuild 14, SonarLint, and the SonarQube scanner for MSBuild. This is confirmed at the beginning of the log:

SonarQube Scanner for MSBuild Begin Step 2.0
Loading analysis properties from c:\Program Files (x86)\tools\MSBuild.SonarQube.Runner-2.1\SonarQube.Analysis.xml
15:25:15.073  Updating build integration targets...
15:25:15.079  Fetching analysis configuration settings...
15:25:15.51  Generating rulesets...
15:25:16.629  Provisioning analyzer assemblies...
15:25:16.63  Installing required Roslyn analyzers...

SonarQube Server is 5.1.2

We used the instructions at http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild#AnalyzingwithSonarQubeScannerforMSBuild-msbuildcompat and the Jenkins integration http://docs.sonarqube.org/display/SCAN/From+Jenkins

I found the question SonarQube warning on MSBuild version but I think we are correctly using SonarLint. What is the cause of the deprecation message?

1
As a second step of the analysis you are running MsBuild on your solution. In the first output line it shows the version MsBuild version number. Does it show something like Microsoft (R) Build Engine version 14.0...?Tamas
It says: Microsoft (R)-Buildmodul, Version 14.0.23107.0 Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten. (we are using the German version, Visual Studio 2015, no updates).Lothar May
That seems good. The message is being written when we can't find the Roslyn generated output file for a project. (In this case we fall back to file-by-file anaysis.) Does MsBuild complete successfully? Can you access the Jenkins workspace? There's a .sonarqube folder next to your solution. In the out folder there are project specific folders, which contain ProjectInfo.xml files. Try to locate one (some) that doesn't have ProjectInfo/AnalysisSettings/Property Name="sonar.cs.roslyn.reportFilePath" XML entries to see which project caused problems.Tamas
Thank you for the hint. We found out that most projects do have the XML entry, but there are some projects without the entry. The projects without the entry are unit test projects and one class library only used by unit test projects. So it seems that this problem is related to test projects. Do you have any hint on how to solve this?Lothar May
I should note that these test projects are excluded in the server configuration by: 13:52:55.962 INFO - Excluded sources for coverage: 13:52:55.962 INFO - **/Projectname/**/*.csLothar May

1 Answers

0
votes

We finally solved this issue by updating everything: We updated the C# plugin in Sonarqube and all Jenkins Plugins (including the msbuild plugin). After that, the deprecation message no longer occurs.