Problems with Sonarqube MSBuild intergration and .NET Core 2.0 applications

317 views
Skip to first unread message

sopal...@gmail.com

unread,
Feb 26, 2018, 1:49:14 PM2/26/18
to SonarQube
I'm having some trouble running the Sonarqube MSBuild Scanner with a .NET Core 2.0 application. 

My script is running
* MSBuild.SonarQube.Runner.exe begin /k:"x" /n:"y" /v:"1.0.0.0" /d:sonar.cs.nunit.reportsPaths="testresults\*_results.xml" /d:sonar.scm.disabled=true /d:sonar.cs.opencover.reportsPaths="coverage_results\*.coverage.xml"
* dotnet publish project/project.csproj -f netcoreapp2.0 -c Release
* MSBuild.SonarQube.Runner.exe end

This ends up with the error: 
SonarQube Scanner for MSBuild 4.0.2
Default properties file was found at C:\SonarQube\SonarQube.Analysis.xml
Loading analysis properties from C:\SonarQube\SonarQube.Analysis.xml
Post-processing started.
The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:
  1. The project has not been built - the project must be built in between the begin and end steps
  2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 upwards are supported
  3. The begin, build or end steps have not all been launched from the same folder
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
18:36:22.94  Creating a summary markdown file...
18:36:22.943  Post-processing failed. Exit code: 1

1. The project has been built, the binaries are present
2. This is using MSBuild 15. Is that a problem?
3. The begin, build and end have been run from the same folder. Does the scan have to be run as the same folder as the csproj?

I appreciate any help.

Regards,
Steve Opalenski 

Amaury Leve

unread,
Feb 26, 2018, 1:57:28 PM2/26/18
to sopal...@gmail.com, SonarQube
Hi Steve, 

We are currently working on improving the logs for this error. But in the meantime here is the problem. 

We use the ProjectGuid as a unique identifier for the project on SonarQube but projects with the new format don't have one. So we implemented a fallback mechanism to read the Guid from the solution. Sadly when you endup with your kind of usage we haven't been able to find an automatic (and consistent) way to have one. 

To workaround the issue you can either add a ProjectGuid to your csproj or use a solution. 

Feel free to get back to us if you are still experiencing some issue. 

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/1e3ebe8d-7199-4fb5-979c-90ef52e22d0c%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? 

sopal...@draftkings.com

unread,
Feb 27, 2018, 4:46:05 PM2/27/18
to SonarQube
Thank you, Amaury. 

I'll try this out. 

Regards,
steve
Reply all
Reply to author
Forward
0 new messages