MSBuild SonarQube Runner with dotnet not working

991 views
Skip to first unread message

michael...@gmail.com

unread,
Jul 4, 2017, 4:18:03 PM7/4/17
to SonarQube
Hi all,

I'm building a project in Jenkins using the the three following commands:

"C:\sonarqube-6.4\bin\MSBuild.SonarQube.Runner.exe" begin /key:"July4" 
dotnet build /v:q -m /p:VersionPrefix=2
"C:\sonarqube-6.4\bin\MSBuild.SonarQube.Runner.exe" end

I get the following output from the console:

16:15:53 C:\Program Files (x86)\Jenkins\jobs\PR_ContentAPI\workspace>"C:\sonarqube-6.4\bin\MSBuild.SonarQube.Runner.exe" begin /key:"July4"  
16:15:53 SonarQube Scanner for MSBuild 3.0
16:15:53 Default properties file was found at C:\sonarqube-6.4\bin\SonarQube.Analysis.xml
16:15:53 Loading analysis properties from C:\sonarqube-6.4\bin\SonarQube.Analysis.xml
16:15:53 Pre-processing started.
16:15:53 Preparing working directories...
16:15:53 16:15:53.616  Updating build integration targets...
16:15:53 16:15:53.632  Fetching analysis configuration settings...
16:15:54 16:15:54.783  Generating rulesets...
16:15:54 16:15:54.807  Provisioning analyzer assemblies for cs...
16:15:54 16:15:54.808  Installing required Roslyn analyzers...
16:15:54 16:15:54.843  Pre-processing succeeded.
16:15:54 
16:15:54 C:\Program Files (x86)\Jenkins\jobs\PR_ContentAPI\workspace>exit 0 
16:15:54 [workspace] $ cmd /c call C:\Windows\TEMP\jenkins6867540904508208794.bat
16:15:54 
16:15:54 C:\Program Files (x86)\Jenkins\jobs\PR_ContentAPI\workspace>"C:\sonarqube-6.4\bin\MSBuild.SonarQube.Runner.exe" begin /key:"July4"  
16:15:54 SonarQube Scanner for MSBuild 3.0
16:15:54 Default properties file was found at C:\sonarqube-6.4\bin\SonarQube.Analysis.xml
16:15:54 Loading analysis properties from C:\sonarqube-6.4\bin\SonarQube.Analysis.xml
16:15:54 Pre-processing started.
16:15:54 Preparing working directories...
16:15:55 16:15:55.011  Updating build integration targets...
16:15:55 16:15:55.023  Fetching analysis configuration settings...
16:15:55 16:15:55.677  Generating rulesets...
16:15:55 16:15:55.702  Provisioning analyzer assemblies for cs...
16:15:55 16:15:55.702  Installing required Roslyn analyzers...
16:15:55 16:15:55.737  Pre-processing succeeded.
16:15:55 
16:15:55 C:\Program Files (x86)\Jenkins\jobs\PR_ContentAPI\workspace>dotnet build /v:q /p:VersionPrefix=2 
16:15:55 Microsoft (R) Build Engine version 15.1.1012.6693
16:15:55 Copyright (C) Microsoft Corporation. All rights reserved.
16:15:55 
16:16:01 
16:16:01 Build succeeded.
16:16:01     0 Warning(s)
16:16:01     0 Error(s)
16:16:01 
16:16:01 Time Elapsed 00:00:05.58
16:16:01 
16:16:01 C:\Program Files (x86)\Jenkins\jobs\PR_ContentAPI\workspace>"C:\sonarqube-6.4\bin\MSBuild.SonarQube.Runner.exe" end 
16:16:01 SonarQube Scanner for MSBuild 3.0
16:16:01 Default properties file was found at C:\sonarqube-6.4\bin\SonarQube.Analysis.xml
16:16:01 Loading analysis properties from C:\sonarqube-6.4\bin\SonarQube.Analysis.xml
16:16:01 Post-processing started.
16:16:01 The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
16:16:01 Possible causes:
16:16:01   1. The project has not been built - the project must be built in between the begin and end steps
16:16:01   2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 upwards are supported
16:16:01   3. The begin, build or end steps have not all been launched from the same folder
16:16:01 Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.

I am unsure as to why this is happening/why the SonarQube analysis isn't working. 
Any help is greatly appreciated.

Thanks in advance

Amaury Leve

unread,
Jul 5, 2017, 2:20:41 AM7/5/17
to michael...@gmail.com, SonarQube

Hi Michael,

We don't yet support analysis of projects built with the dotnet build command (only through msbuild) so that's why you have a message saying the analysis failed.

We have a ticket in our backlog to support dotnet build (will do a follow up with the link later on).

Cheers,
Amaury


--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/732f2c10-7408-4508-ae99-7992fb5ae6ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Amaury Levé | SonarSource

Software Developer - .Net Team

http://sonarsource.com


Are you using SonarLint in your IDE? 

peti...@gmail.com

unread,
Jul 17, 2017, 11:22:24 PM7/17/17
to SonarQube, michael...@gmail.com
I'm finding that even when using msbuild I'm not getting any analysis results for C# projects targeting netstandard1.6 or netcoreapp1.1.

The sonarqube analysis completes successfully and the .cs files appear in the list of source paths and the code tab.  However, no issues appear and none of the lines of code are counted as C#.

The C# plugin is at version 6.1.0.2359.

Thanks,
Michael
Reply all
Reply to author
Forward
0 new messages