Search code examples
jenkinssonarqubesonarlintsonarlint-vs

SonarQube MSBuild scanner: How to fix MSBuild 12 / sonar-runner deprecation message


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?


Solution

  • 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.