SonarQube - Scanner execution issue

Hello,

I developed the project using in C #.net and plan to use the SonarQube for code quality and security. I am using to Install SonarQube using a docker-compose file in Windows Server 2019.

  • Docker Engine - v20.10.5
  • docker-compose version 1.29.0, build 07737305
  • sonar-scanner-msbuild-5.2.0.29862-net46

I tried to scan my code with SonarScanner for .NET, but I got the below error message in the last step. I have executed the given below 3 steps, but I have an issue with the last step.

Step 1 : SonarScanner.MSBuild.exe begin /k:“ZOOM” /d:sonar.host.url=“http://localhost:9000” /d:sonar.login=“393f6ad2162d414b8514b467d0a4dab391a4cb5d”

Step 2: MsBuild.exe /t:Rebuild

Step 3: SonarScanner.MSBuild.exe end /d:sonar.login=“393f6ad2162d414b8514b467d0a4dab391a4cb5d”

I followed the steps given by the SonarQube, but while executing the 3rd step I have an error message given below. So kindly check and advise.


C:\Users\Administrator\Downloads\sonar-scanner-msbuild-5.2.0.29862-net46>SonarScanner.MSBuild.exe end /d:sonar.login=“393f6ad2162d414b8514b467d0a4dab391a4cb5d”
SonarScanner for MSBuild 5.2
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
21:30:48.635 The SonarScanner for 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.25420.1 and higher are supported.
  3. The begin, build and end steps have not all been launched from the same folder
  4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
    21:30:48.638 Generation of the sonar-properties file failed. Unable to complete the analysis.
    21:30:48.654 Post-processing failed. Exit code: 1

Thanks,
Sakthivel S

Hi,

Do any of the conditions in the error message apply to you?

Also, you’ve just revoked that analysis token you exposed to the world^. Right?

 
Ann

Hi Ann,

Thanks for your response, Not like that I just follow the steps given in the sonarqube server.

while I am doing step 3, I got the above error message.

Thanks,
Sakthivel S

Hi @Sakthivel - did you find a solution in the end?

Hello @Andrei_Epure,

No i don’t have the solution for that, if you had the solution please share it will helps me to complete the process.

Thanks,
Sakthivel S

Hello

Could you please reply to the following questions?

  • what is the version of SonarQube that you are using?
  • are you running all commands from the same folder?
  • what is the version of MSBuild you are using?
  • please give us the verbose output of the command (please run SonarScanner.MSBuild.exe begin /k:“MyProject” /d:sonar.verbose=true as the begin step, and please attach the output of the BEGIN and END steps)
  • please give the verbose msbuild logs msbuild /v:d > build.log