Msbuild during scanner doesn´t finish


I have SonarQube 9.6.1, SonarScanner for MSBuild 5.2.1 and MSBuild 15.9.21.

When I perform sonar scanner process to analyse the code:

SonarScanner.MSBuild.exe begin /k:“PROJECT” /“http://localhost:9000” /d:sonar.login=Token
msbuild Solution.sln /t:Rebuild

I launch to build Solution.sln, but when it has created the folder .sonarqube\out\4 it does not advance and never ends.

From Visual Studio its build correctly and finish.

I have runned the scan in DEBUG until it remains stuck. I attached the full log:
scan.log (4.0 MB)

Can anyone help me with this problem?


Hi @dalgarra,

thanks for your feedback.

It looks to me that the build and analysis were in progress when they were stopped (analyzing mpm.Tarificador.Logica.csproj). How long did you wait until you cancelled the build and how long does the build usually takes?

Do you know if there is a single project that is causing this?

Hi, Costin. I think I was too impatient and canceled the scan early, because I tried again and in a couple of hours it was over. Sorry, you can close the thread.

Hi David,

thanks a lot for the update. A couple of hours is already long. Would it be possible to generate the binary log when calling msbuild in verbose mode (while doing the analysis) and send it to us?

something similar with

SonarScanner.MSBuild.exe begin ...
dotnet build --no-incremental /p:reportanalyzer=true -bl:build.binlog


SonarScanner.MSBuild.exe begin ...
msbuild Solution.sln /t:Rebuild /p:reportanalyzer=true -bl:build.binlog

It will contain a report with the time spent in our analyzers and we could see what rules are expensive and where should invest our time to improve the performance.

Thank you,