Msbuild during sonar scanner doesn´t end

Hi everyone!

I have sonarqube 8.7, sonar scanner for .net4.6 version and msbuild 15.0.

When I perform sonar scanner process to analyse the code with the steps said in guide:

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

Where solution.sln is coded in c# and has project1.csproj, project2.csproj and project3.csproj.

I launch to build the solution.sln, project1.csproj and project2.csproj built it correctly, but when we try to build project3.csproj it never end over the time (it persist in same point all times).

It’s important to said that if I built them without sonar scanner its build correctly and finish in the stipulated time.

I have tried with different mbuilds (Visual studio 2017 and 2019) and on different machines but keeps happening.

Can anyone help me with this problem?

Thanks in advance.

Hello @monica,

What you describe could be a bug in the Scanner for .Net. However before we can investigate you would have to upgrade to the latest version of the Scanner (5.2.2, see SonarScanner for .NET | SonarQube Docs) and the latest version of SonarQube (8.9.x, see Download | SonarQube), and retest.
If you still reproduce with these latest versions, we’ll dig deeper.


Hello @OlivierK,

I upgrade Sonarqube to 8.9 and scanner to 5.2.2 and the problem still occurs.
What are the next steps?


Hello @monica ,

Can you run the scan in DEBUG until it remains stuck and send the full log

SonarScanner.MSBuild.exe begin /k:<project> \
    /d:"" \
    /d:"sonar.login=<token>" /d:"sonar.verbose=true"       > scan.log
msbuild solution.sln /t:Rebuild                           >> scan.log
SonarScanner.MSBuild.exe end /d:"sonar.login=<token>"     >> scan.log

Please send me the scan.log file (not inline, but as a zip attachment to this thread)


Hello @OlivierK,

Due to company policy I cannot send you the build log of the solution.

I send you the begin process here:
begin.log (6.4 KB)

I send you the msbuild process filtered here:
msbuild.log (3.1 KB)

I can’t send you the end process log because the msbuild never ends and if I want to finish it, I only can stop it with CTRL+C (but this project doesn’t build ever).


Hello @OlivierK ,

A few months have passed and I have not received a response.

Did you review the logs?


Hello @monica,

Thanks for minging me. I reviewed the logs at the time and did not see anything that could explain the problem. I looked again today. One thing I noticed is that it seems to be a sample project. Would it be possible to share this sample project with me so that I can do some tests on my side ? A simple zip of the project from its root directory (were the SLN is) would do. It would even be possible to share with me privately if that is more acceptable to you.


Hello @OlivierK,

I have good news. The problem was solved when we upgrade to new version of SonarQube (9.3).

Thanks for all your help with this case.


Hello @monica, great news, thank you so much for letting me know so long later !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.