Sonar Scanner on projects .NET Project -main branch has no lines

Used following steps:

Executed on local drive- D:\projects\Processing>

Service - C:\Sonar\sonarqube-\sonarqube-\bin\windows-x86-64\ StartSonar.bat

Step 1-


"C:\Sonar\sonar-scanner-msbuild-\ SonarScanner.MSBuild.exe" begin /k:“NCS_Scan_01” /d:sonar.login=“5f5069fa565a1421f56fd242308a7192a7419c3e”

Step 2-


"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\amd64\ MSBuild.exe " /t:Rebuild

Step 3-


C:\Sonar\sonar-scanner-msbuild-\ SonarScanner.MSBuild.exe end /d:sonar.login=“5f5069fa565a1421f56fd242308a7192a7419c3e”

also I have updated environment variables:

Please if you could let me know I have missed on a parameter settings. As still I am getting report as:

The main branch has no lines of code.

Hey there.

Anything interesting in the logs when you ran SonarScanner.MSBuild.exe end? Did it succeed? Any warnings?

Yes, The build succeeded did generate the Link localhost:9000/projects but reports says
‘The main branch has not lines of code’,
Used Sonarqube, MSBuild -, jdk-11.0.6. Please suggest

Got it resolved, Source Code was incorrectly setup. As I was able to set code appropriately, My SonarQube, Scanner worked fine. Forum help appreciated.!

1 Like

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