Project language setting

Hi,

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 - 8.3.0.34182
MSBuild version: 16.11.0.36601

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)

Thanks.
Here is the version information:
Version of Scanner for .NET (MSBuild): sonar-scanner-msbuild-5.4.0.40033-net46
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:
output1.zip (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:
output2.zip (109.5 KB)

After run SonarScanner.MSBuild.exe end, the output was:
output3.zip (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

Hi
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.