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-9.2.4.50792\sonarqube-9.2.4.50792\bin\windows-x86-64\ StartSonar.bat

Step 1-

Command:

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

Step 2-

Command:

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

Step 3-

Command:-

C:\Sonar\sonar-scanner-msbuild-5.4.1.41282-net46\ 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 9.2.4.50792, MSBuild - 5.4.1.41282, 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.