Mixed languages C# and vb.net using DotCover

Version: Sonarqube Version 6.7 (build 33306)
Goal: Display coverage percentage for .net solution using C# and vb.net

Im very new in Sonar and Teamcity, Im trying to configure the coverage percentage. My project has a mix of languages C# and vb.net but in Sonar page result I only see C# classes.
At the moment my steps are:

- Clean Solution
- Nuget Restore
- Build Solution (Rebuild)
- Run test using VSTests and dotcover
- Generation of html file (using powershell)
Write-Host “Generating Coverage…”

$snapshot = Get-ChildItem “%system.teamcity.build.tempDir%” -Filter coverage_dotcover*.data | select -ExpandProperty FullName -First 1
%teamcity.dotCover.home%\dotCover.exe report /ReportType=HTML /Source="$snapshot" /Output=“TestResults/CoverageReport.html”
%teamcity.dotCover.home%\dotCover.exe report /ReportType=XML /Source="$snapshot" /Output=“TestResults/CoverageReport.xml”

- SonarQube Runner
Additional Parameters:


Note: if I remove “-Dsonar.language=cs” I get an error saying:
[Step 6/7] 15:33:09.628 ERROR: Error during SonarQube Scanner execution

[15:33:09] [Step 6/7] 15:33:09.628 INFO: Final Memory: 76M/702M

[15:33:09] [Step 6/7] 15:33:09.628 INFO: ------------------------------------------------------------------------

[15:33:09] [Step 6/7] org.sonar.java.AnalysisException: Please provide compiled classes of your project with sonar.java.binaries property

[15:33:09] [Step 6/7] at org.sonar.java.JavaClasspath.init(JavaClasspath.java:66)

Many thanks for your help!

Hello and welcome to our community.

We do not own the TeamCity integration. You could check the github repo TeamCity.SonarQubePlugin and the SonarQube Integration TeamCity documentation.

Related topic How to integrate SonarQube with Git and Teamcity