SonarQube + ASP.net core 5 + dotcover reports 0% coverage

Using:

dotnet-sonarscanner/5.0.4/ SonarQube 8.3.1 build 34397

Tying to get coverage on an asp.net core app with dotCover
What I have tried so far

# Start the scan
cd /src
coverfile=$(echo "/src/$test_project_folder/coverage.html" | sed 's|\./||g')
echo $coverfile
dotnet-sonarscanner begin /k:$project_name \
  /v:$project_version \
  /d:sonar.verbose=true \
  /d:sonar.host.url=$sonar_url \
  /d:sonar.sources=$sources \
  /d:sonar.cs.dotcover.reportsPaths=$test_project_folder/coverage.html \
  /d:sonar.scm.disabled=true \
  /d:sonar.sourceEncoding=UTF-8 \
  /d:sonar.exclusions=$test_project_folder/**/*.cs \
  /d:sonar.projectBaseDir=/src/

# Build the solution
dotnet build "$solution_path"

# Run tests with coverage
cd $test_project_folder
dotCover.sh dotnet --output=$coverfile --reportType=html -- test
cd $OLDPWD

# Upload the results of the scan
dotnet-sonarscanner end

The above is the batch file to run the scanner.

The run looks like this:

SonarScanner for MSBuild 5.0.4
Using the .NET Core version of the Scanner for MSBuild
Default properties file was found at /root/.dotnet/tools/.store/dotnet-sonarscanner/5.0.4/dotnet-sonarscanner/5.0.4/tools/net5.0/any/SonarQube.Analysis.xml
Loading analysis properties from /root/.dotnet/tools/.store/dotnet-sonarscanner/5.0.4/dotnet-sonarscanner/5.0.4/tools/net5.0/any/SonarQube.Analysis.xml
sonar.verbose=true was specified - setting the log verbosity to 'Debug'
Pre-processing started.
Preparing working directories...

Executing file /root/.dotnet/tools/.store/dotnet-sonarscanner/5.0.4/dotnet-sonarscanner/5.0.4/tools/net5.0/any/sonar-scanner-4.4.0.2170/bin/sonar-scanner
  Args: -Dsonar.scanAllFiles=true -Dproject.settings=/src/.sonarqube/out/sonar-project.properties --from=ScannerMSBuild/5.0.4 --debug 
  Working directory: /src
  Timeout (ms):-1
  Process id: 337
03:53:13.375 INFO: Scanner configuration file: /root/.dotnet/tools/.store/dotnet-sonarscanner/5.0.4/dotnet-sonarscanner/5.0.4/tools/net5.0/any/sonar-scanner-4.4.0.2170/conf/sonar-scanner.properties
03:53:13.380 INFO: Project root configuration file: /src/.sonarqube/out/sonar-project.properties
03:53:13.469 INFO: SonarScanner 4.4.0.2170
03:53:13.469 INFO: Java 11.0.9.1 Debian (64-bit)
03:53:13.469 INFO: Linux 5.4.39-linuxkit amd64
03:53:13.841 DEBUG: keyStore is : 
03:53:13.841 DEBUG: keyStore type is : pkcs12
03:53:13.841 DEBUG: keyStore provider is : 
03:53:13.842 DEBUG: init keystore
03:53:13.843 DEBUG: init keymanager of type SunX509
03:53:14.102 DEBUG: Create: /root/.sonar/cache
03:53:14.105 INFO: User cache: /root/.sonar/cache
03:53:14.106 DEBUG: Create: /root/.sonar/cache/_tmp
03:53:14.112 DEBUG: Extract sonar-scanner-api-batch in temp...
...
03:53:29.362 DEBUG: The current user dir is '/src'.
03:53:29.362 INFO: Aggregating the HTML reports from '/src/././Source/ttest-service-test/coverage.html'.
03:53:29.367 DEBUG: dotCover aggregator: collected 7 report files to parse.
03:53:29.367 INFO: Parsing the dotCover report /src/././Source/ttest-service-test/coverage/src/3.html
03:53:29.375 INFO: Parsing the dotCover report /src/././Source/ttest-service-test/coverage/src/2.html
03:53:29.379 INFO: Parsing the dotCover report /src/././Source/ttest-service-test/coverage/src/4.html
03:53:29.385 INFO: Parsing the dotCover report /src/././Source/ttest-service-test/coverage/src/6.html
03:53:29.392 INFO: Parsing the dotCover report /src/././Source/ttest-service-test/coverage/src/1.html
03:53:29.395 INFO: Parsing the dotCover report /src/././Source/ttest-service-test/coverage/src/5.html
03:53:29.398 INFO: Adding this code coverage report to the cache for later reuse: /src/././Source/ttest-service-test/coverage.html
03:53:29.401 DEBUG: Analyzing coverage after aggregate found '6' coverage files.
03:53:29.402 DEBUG: Skipping '/src/Source/ttest-service-test/Controllers/LivenessControllerTest.cs' as it is a test file.
03:53:29.402 DEBUG: Skipping '/src/Source/ttest-service-test/Model/TTestServiceRequestTest.cs' as it is a test file.
03:53:29.403 DEBUG: Skipping '/src/Source/ttest-service-test/TestHelper.cs' as it is a test file.
03:53:29.403 DEBUG: Skipping '/src/Source/ttest-service-test/Model/TTestServiceResultTest.cs' as it is a test file.
03:53:29.403 DEBUG: Skipping '/src/Source/ttest-service-test/Controllers/TTestControllerTest.cs' as it is a test file.
03:53:29.404 DEBUG: Skipping '/src/Source/ttest-service-test/IntegrationUnitTests/IntegrationControllerTest.cs' as it is a test file.
03:53:29.404 DEBUG: The total number of file count statistics is '6'.
03:53:29.405 INFO: Coverage Report Statistics: 6 files, 0 main files, 0 main files with coverage, 6 test files, 0 project excluded files, 0 other language files.
03:53:29.406 WARN: The Code Coverage report doesn't contain any coverage data for the included files. For troubleshooting hints, please refer to https://docs.sonarqube.org/x/CoBh
03:53:29.406 INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=51ms
03:53:29.407 INFO: ------------- Run sensors on project
03:53:29.419 DEBUG: 'Generic Coverage Report' skipped because one of the required properties is missing
03:53:29.420 DEBUG: 'Java CPD Block Indexer' skipped because there is no related file in current project
03:53:29.422 DEBUG: Sensors : Zero Coverage Sensor
03:53:29.422 INFO: Sensor Zero Coverage Sensor
03:53:29.454 INFO: Sensor Zero Coverage Sensor (done) | time=32ms
03:53:29.458 INFO: SCM Publisher is disabled
03:53:29.478 INFO: CPD Executor Calculating CPD for 7 files
03:53:29.480 DEBUG: Detection of duplications for /src/Source/ttest-service/Controllers/TtestController.cs
03:53:29.514 DEBUG: Detection of duplications for /src/Source/ttest-service/Program.cs
03:53:29.518 DEBUG: Detection of duplications for /src/Source/ttest-service/Controllers/LivenessController.cs
03:53:29.521 DEBUG: Detection of duplications for /src/Source/ttest-service/Model/TTestServiceRequest.cs
03:53:29.524 DEBUG: Detection of duplications for /src/Source/ttest-service/KeycloakInfo.cs
03:53:29.526 DEBUG: Detection of duplications for /src/Source/ttest-service/Model/TTestServiceResult.cs
03:53:29.528 DEBUG: Detection of duplications for /src/Source/ttest-service/Startup.cs
03:53:29.535 INFO: CPD Executor CPD calculation finished (done) | time=54ms
03:53:29.706 INFO: Analysis report generated in 163ms, dir size=104 KB
03:53:29.830 INFO: Analysis report compressed in 122ms, zip size=40 KB
03:53:29.830 INFO: Analysis report generated in /src/.sonarqube/out/.sonar/scanner-report
03:53:29.830 DEBUG: Upload report
03:53:29.974 DEBUG: POST 200 https://sonar.netadds.net/api/ce/submit?projectKey=oom-api-ttest | time=141ms
03:53:29.979 INFO: Analysis report uploaded in 148ms
03:53:29.984 DEBUG: Report metadata written to /src/.sonarqube/out/.sonar/report-task.txt
03:53:29.984 INFO: ANALYSIS SUCCESSFUL, you can browse http://sonar.netadds.net/dashboard?id=oom-api-ttest
03:53:29.984 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
03:53:29.985 INFO: More about the report processing at http://sonar.netadds.net/api/ce/task?id=AXZFofKZI3Jam1LN750A
03:53:29.993 DEBUG: Post-jobs : 
03:53:30.001 INFO: Analysis total time: 7.640 s
03:53:30.004 INFO: ------------------------------------------------------------------------
03:53:30.005 INFO: EXECUTION SUCCESS
03:53:30.005 INFO: ------------------------------------------------------------------------
03:53:30.005 INFO: Total time: 16.697s
03:53:30.091 INFO: Final Memory: 8M/40M
03:53:30.092 INFO: ------------------------------------------------------------------------
Process returned exit code 0
The SonarScanner CLI has finished
03:53:30.158  Post-processing succeeded.

When I visit the website, the coverage is 0%.
My earlier attempt using coverlet yielded 95+% coverage on the site.
The log seems to indicate that it recognizes the dotCover.sh generated report.

How do I use dotCover.sh with Sonar so that it works?

hello, did you read the [Coverage] Troubleshooting guide for .NET code coverage import?