C# The main branch has no lines of code

I use sln to build a multiple modules C# code with the flow steps, all steps work successful, but sonarqube got “The main branch has no lines of code”.

The component versions:
Java version: 11.0.14
sonarqube: 9.3
MSBuild.exe: 16.11.2.50704
Sonar-scanner-msbuild: 5.5.3.43281-net46
.net framework: 4.6.1
database: postgres-14.2

1、SonarScanner.MSBuild.exe begin/k: UiAutoRPAStudio
2、 MSBuild.exe/p: Configuration = Release/t: Restore/t: Rebuild/t: Pack-p: Authors = test
3、 SonarScanner.MSBuild.exe end

And i got the following result without error.

The end step log (47.0 KB)
The .sonarqube zip file (3.9 MB)


Hey there.

INFO: 1111 files ignored because of scm ignore settings

SonarQube tries to exclude files based on what it finds in your .gitignore file – you might want to make sure you don’t have some unnecessarily large ignore pattern configured (or share your .gitignore file so we can check it out`.

In the meantime, you can set the sonar.scm.exclusions.disabled=true analysis parameter in order to make sure your files are indexed.

I delete the .gitignore file, it works fine. but i don’t understand which role worked, my C# code has not been ignored by the .gitignore file.

gitignore.txt (3.9 KB)

And where i can set the sonar.scm.exclusions.disabled parameter.

You’ll want to append /d:<analysis-parameter>=<value> to your SonarScanner.MSBuild.exe begin command.

You may also find the documentation on SonarScanner for .NET helpful.

I see, and which of my .gitignore file role was worked for sonar?

Hi @annpeter ,
I’m not sure I understood your question. If you’re trying to find out which entry in the .gitignore cause the scanner to ignore all the files, we wouldn’t be able to answer that.
The scanner uses git to load the list of files are not ignored without interpreting directly the file.
We have recently found that there is a bug related to submodules, causing many files to be ignored. There are no other known problems which doesn’t mean there couldn’t be other problems.