Project language setting


I’m a newbie in sonarqube.

in previous analysis, it can correctly identify as c# project.

we analyzed recently on same solution and found that it treat it as a XML project.

And so, the LOC cannot correctly be shown. Is their anyway to fix it?

It is a .net 4.0 winform solution.
SonarQube version -
MSBuild version:

command we run:
SonarScanner.MSBuild.exe begin /k:VersionChecker /d:sonar.login=“xxxx”
“C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe” “BrokerRolloutVersions.sln” /t:Rebuild
SonarScanner.MSBuild.exe end /d:sonar.login=“xxxx”

Hello and welcome to the community!

Please note that you should use only supported SQ versions.

Please give us the following version information:

And we’ll need the logs:

  • please give us the verbose output of the scanner commands (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 output of running MSBuild in verbose mode (/v:d)

Here is the version information:
Version of Scanner for .NET (MSBuild): sonar-scanner-msbuild-
Version of MSBuild: v16.11.0.36601

and here is the output of each commands:
After run SonarScanner.MSBuild.exe begin /k:VersionChecker /d:sonar.verbose=true, the output was: (1.4 KB)

After run “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe” “BrokerRolloutVersions.sln” /t:Rebuild /v:d, the output was: (109.5 KB)

After run SonarScanner.MSBuild.exe end, the output was: (12.0 KB)

The key point is to ensure all your relevant sources are included in the .sonar.sources property for each of the projects.

For example, the FrmDBConfiguration.cs is included as a source for the scan. And

15:04:04.771 DEBUG: ‘BrokerRolloutVersions\FrmDBConfiguration.cs’ indexed with language ‘cs’

which means the scanner sees it.

Also, in

we see that issues are being raised on FrmDBConfiguration.cs.

It is very strange that there are no issues shown in SonarQube.

Before moving forward, I see you are using

which is not supported.

Could you please use a supported version, and we’ll continue the investigation?

Supported version is either the latest LTS (8.9.x) or the latest release - see Download | SonarQube

We just upgraded to v8.9.6.50800 and found that the problem has been solved.
Thanks for help.

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