Sonarqube showing Dotnet code as physical lines instead of Lines of code

Hi All,
We are facing issue with Sonarqube scanner for MSbuild. The c#/VB.net code is showing in physical lines instead of lines of code. The lines of code for c# page is showing “0” even there is code in the file.
Please help us with the issue.
Is there any alternative way to get the lines of code

Thank you,
Vijay G.

hello @VijayG. Welcome to this community forum. Please give us more details.

  • what is the version of SonarQube that you are using?
  • what is the version of the C# plugin?
  • what is the version of Scanner for MSBuild you are using?
  • what are the commands you are running to do the analysis?
  • are you running all commands from the same folder?
  • what is the version of MSBuild you are using?
  • 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 END step
  • could you please share the .sonarqube\conf\SonarQubeAnalysisConfig.xml and the .sonarqube\conf\sonar-project.properties

Please note that the .sonarqube folder is in the directory you run the analysis from.

sonar-project.txt (7.5 KB) SonarQubeAnalysisConfig.txt (10.3 KB)

Hi Epure,

Thanks for the response. Please find below details

• what is the version of SonarQube that you are using?
v8.1
• what is the version of the C# plugin?
v8.1
• what is the version of Scanner for MSBuild you are using?
sonar-scanner-msbuild-4.6.0.1930
• what are the commands you are running to do the analysis?
SonarScanner.MSBuild.exe begin /k:“MyProject”
MSBuild.exe /t:rebuild sample.sln
SonarScanner.MSBuild.exe end
Provided the files by masking the data
• are you running all commands from the same folder?
Yes
• what is the version of MSBuild you are using?
v14.0

hi @VijayG

I see that in your sonar-project.txt you only have VB .NET code, so the there’s no C# source code to be analyzed.

Can you please give the verbose output of the END command (please run SonarScanner.MSBuild.exe begin /k:“MyProject” /d:sonar.verbose=true as the begin step, and please attach the output of END step).

Thanks
Andrei