SonarQube 9.9 not showing Lines of Code (– dash) for .NET Core 3.0 project – only Dockerfile LOC vis

Description / Issue:

We are experiencing an issue where SonarQube 9.9 does not display Lines of Code (LOC) for our .NET Core 3.0 project. Instead of showing LOC, SonarQube displays a dash (–) for all C# files.
Only the Dockerfile LOC is detected and visible in the UI.


Environment Details:

Component Version / Info
SonarQube 9.9 (LTS)
SonarScanner 5.0.2.4997
Java Runtime Java 17
.NET Version .NET Core 3.0
Build Tool Azure DevOps Classic Pipeline
OS / Agent Linux (Ubuntu 4.15.0-142 kernel)

What We Have Already Tried (Troubleshooting Steps):

:check_mark: Verified and configured correct path for code coverage.
:check_mark: Created a new basic pipeline, but the issue persisted.
:check_mark: Performed a standalone analysis with SonarScanner CLI — still LOC shows as (–).
:check_mark: Updated multiple <PropertyGroup> configurations in .csproj, but no change.
:check_mark: Added sonar.sources property – briefly saw duplicate file warnings, but confirmed there are no duplicates.
:check_mark: Added correct include paths, but lines of code are still not detected.

Hey there.

You must use the SonarScanner for .NET to analyze .NET code. You cannot use the SonarScanner CLI.

:warning: And, your version is past EOL. You should update to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your update path is:

9.9-> 2025.1.4 → 2025.5 (last step optional)

Or, if you’re using Community Build

9.9-> 24.12 → 25.11 (last step optional)