SonarQube C# Code Coverage include Unit Test Project

hey @sonnguyen16694 and welcome to our community

Please answer the following questions

  1. which version of the scanner for MSBuild are you using?

  2. which version of .NET are you targeting?

  3. Are you running the commands in the following order? (see [Coverage & Test Data] Generate Reports for C#, VB.net )

SonarScanner.MSBuild.exe begin /k:“project-key”
MSBuild.exe /t:Rebuild
…RUN CODE COVERAGE COMMANDS HERE …
SonarScanner.MSBuild.exe end

  1. are you running all the commands inside the same folder?

  2. are the coverage reports for the projects you don’t see in SQ being produced correctly? (i.e. does the coverage report file exist on disk)

  3. Please add /d:sonar.verbose=true to the BEGIN step (e.g. SonarScanner.MSBuild.exe begin /k:"MyProject" /d:sonar.verbose=true) and please attach here in a file the output of END step