We are trying to analyse VB.Net code using SonarQube. The testcases run correctly and the codeCoverage.xml is also generated. But the code coverage is not reflected on the SonarQube Dashboard. It is always shown as 0%.
The generated code coverage when imported into Visual Studio, does show the code coverage.
Explicitly setting the SonarQube language property in the Prepare SonarQube Analysis Task doesn’t help.
We are using SonarQube 7.9.1,
Scanner for MSBuild 4.7.1
VBNet plugin 7.15.0
We are using Git SCM
Searched lot of options on internet but none of them could fetch success.
Any help would be greatly appreciated.
Can you describe your build process? To include test coverage, you will need to execute unit tests just after build and before the SonarScanner for MSBuild’s end step. Also what kind of unit test are you using?
Additional Properties:
a. sonar.scm.exclusion.disabled=false
b. sonar.language = vbnet
c. sonar.verbose = true
d. sonar.log.level = DEBUG
e. sonar.vb.vscoveragexml.reportsPaths = **/*.coveragexml
Nuget Restore
Build Solution
- Visual Studio Version = 2017
- Platform = any cpu
- Configuration = release
- MSBuild Architecture = x86
Test Assemblies
- vstest.console.exe Identifies the test cases from working directory & executes the
testcases
Run Code Analysis
- Publish the results to SonarQube Dashboard
The application target .Net Framework 2.0. Can we explicitly specify the framework during code analysis ? Also does the framework matter during code analysis ?