# When am running SonarCloud integration with VSTS in Code Coverage section it is showing 0.0%,please help me how to get the report

**URL:** <https://community.sonarsource.com/t/when-am-running-sonarcloud-integration-with-vsts-in-code-coverage-section-it-is-showing-0-0-please-help-me-how-to-get-the-report/5244>\
**Category:** SonarQube Cloud\
**Tags:** azuredevops-services, csharp, coverage\
**Created:** [December 19, 2018, 6:08am UTC](https://community.sonarsource.com/t/when-am-running-sonarcloud-integration-with-vsts-in-code-coverage-section-it-is-showing-0-0-please-help-me-how-to-get-the-report/5244 "2018-12-19T06:08:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_Sidda\_Reddy](https://avatars.discourse-cdn.com/v4/letter/_/94ad74/32.png) [@\_Sidda\_Reddy](https://community.sonarsource.com/u/_Sidda_Reddy)\
**Post date:** [December 19, 2018, 6:08am UTC](https://community.sonarsource.com/t/when-am-running-sonarcloud-integration-with-vsts-in-code-coverage-section-it-is-showing-0-0-please-help-me-how-to-get-the-report/5244/1 "2018-12-19T06:08:09Z")

</div>

![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/7/7c0dc4eeaaa44262679dd2a8cfa6ecd24e43d3e6.png)

---

<div class="post-metadata">

**Author:** ![Daniel-Svensson](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/daniel-svensson/32/2151_2.png) [@Daniel-Svensson](https://community.sonarsource.com/u/Daniel-Svensson)\
**Post date:** [January 4, 2019, 11:06am UTC](https://community.sonarsource.com/t/when-am-running-sonarcloud-integration-with-vsts-in-code-coverage-section-it-is-showing-0-0-please-help-me-how-to-get-the-report/5244/2 "2019-01-04T11:06:14Z")

</div>

if you look at the analyse log, deos it detect and upload the coverage? otherwise this might be related to [https://github.com/Microsoft/azure-pipelines-tasks/issues/7975](https://github.com/Microsoft/azure-pipelines-tasks/issues/7975)

---

<div class="post-metadata">

**Author:** ![Ammo](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ammo/32/30_2.png) [@Ammo](https://community.sonarsource.com/u/Ammo)\
**Post date:** [January 4, 2019, 12:54pm UTC](https://community.sonarsource.com/t/when-am-running-sonarcloud-integration-with-vsts-in-code-coverage-section-it-is-showing-0-0-please-help-me-how-to-get-the-report/5244/3 "2019-01-04T12:54:30Z")

</div>

Hi @Daniel-Svensson,

Have you followed the instructions on this page: [https://docs.sonarqube.org/x/CoBh](https://docs.sonarqube.org/x/CoBh)

The logs will tell you if any coverage report was found.

Cheers,  
Amaury

---

<div class="post-metadata">

**Author:** ![Daniel-Svensson](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/daniel-svensson/32/2151_2.png) [@Daniel-Svensson](https://community.sonarsource.com/u/Daniel-Svensson)\
**Post date:** [January 4, 2019, 6:29pm UTC](https://community.sonarsource.com/t/when-am-running-sonarcloud-integration-with-vsts-in-code-coverage-section-it-is-showing-0-0-please-help-me-how-to-get-the-report/5244/4 "2019-01-04T18:29:22Z")

</div>

My comment was about the VSTS (azure devops / pipelines) plugin ([https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Extension+for+VSTS-TFS](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Extension+for+VSTS-TFS)).

The setup steps are a bit different that the link you mention since that tells you how to execute everything from the command (which by the way works fine).

The extension is (was) great since it automatically find and import unit test and coverage files using the “.trx” fil. The issue is that the vstest step has changed so that they save the file somewhere where the plugin does not look (even if you change the trx search path)

---

<div class="post-metadata">

**Author:** ![felipeoriani](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/felipeoriani/32/2289_2.png) [@felipeoriani](https://community.sonarsource.com/u/felipeoriani)\
**Post date:** [January 24, 2019, 12:30pm UTC](https://community.sonarsource.com/t/when-am-running-sonarcloud-integration-with-vsts-in-code-coverage-section-it-is-showing-0-0-please-help-me-how-to-get-the-report/5244/8 "2019-01-24T12:30:49Z")

</div>

Hey @Daniel-Svensson

I have the same issue here. I am using the build steps recommended on the [documentation](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Extension+for+VSTS-TFS) and it works fine but the code coverage is always 0%. I can see on the log that the `.trx` file was generated but as you said, even changing the way of how to speficy the path of the file it does not work.

Is there any way (or workaround) to get it working?

Thank you.

---

<div class="post-metadata">

**Author:** ![Daniel-Svensson](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/daniel-svensson/32/2151_2.png) [@Daniel-Svensson](https://community.sonarsource.com/u/Daniel-Svensson)\
**Post date:** [January 24, 2019, 1:50pm UTC](https://community.sonarsource.com/t/when-am-running-sonarcloud-integration-with-vsts-in-code-coverage-section-it-is-showing-0-0-please-help-me-how-to-get-the-report/5244/9 "2019-01-24T13:50:22Z")

</div>

Use vstest v1 task instead of v2 to get it working  
. See [Azure DevOps (VSTS) extension no longer import coverage and unit tests automatically](https://community.sonarsource.com/t/azure-devops-vsts-extension-no-longer-import-coverage-and-unit-tests-automatically/5574/5)

---

<div class="post-metadata">

**Author:** ![felipeoriani](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/felipeoriani/32/2289_2.png) [@felipeoriani](https://community.sonarsource.com/u/felipeoriani)\
**Post date:** [January 24, 2019, 2:27pm UTC](https://community.sonarsource.com/t/when-am-running-sonarcloud-integration-with-vsts-in-code-coverage-section-it-is-showing-0-0-please-help-me-how-to-get-the-report/5244/10 "2019-01-24T14:27:31Z")

</div>

Hi @Daniel-Svensson, yes, I am using the v1 but there is no results yet. In the logs I can see the `.trx` file was generated and when I access my build server I can see the file on the disk, but, the code coverage on sonarQube is still 0% even all testing running and passing during the build. I have defined on the `Prepare analysis on SonarQube` the argument:

`sonar.cs.vstest.reportsPaths=**\*.trx`

On the vstest build step I checked the `Code Coverage Enabled`. See the configs.  
What am I doing wrong?

Does Visual Studio Community installed on the machine affects it or it does not matter?

Please help me 😃.  
Thank you.

![tests](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/7/7571550e5da64c20e0781cb74a9261f01ed0059a.png)

---

<div class="post-metadata">

**Author:** ![Fabrice\_Bellingard](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/fabrice_bellingard/32/39_2.png) [@Fabrice\_Bellingard](https://community.sonarsource.com/u/Fabrice_Bellingard)\
**Post date:** [January 30, 2019, 4:06pm UTC](https://community.sonarsource.com/t/when-am-running-sonarcloud-integration-with-vsts-in-code-coverage-section-it-is-showing-0-0-please-help-me-how-to-get-the-report/5244/11 "2019-01-30T16:06:51Z")

</div>

This thread duplicates [Azure DevOps (VSTS) extension no longer import coverage and unit tests automatically](https://community.sonarsource.com/t/azure-devops-vsts-extension-no-longer-import-coverage-and-unit-tests-automatically/5574).

I’m closing it.

---

<div class="post-metadata">

**Author:** ![Fabrice\_Bellingard](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/fabrice_bellingard/32/39_2.png) [@Fabrice\_Bellingard](https://community.sonarsource.com/u/Fabrice_Bellingard)\
**Post date:** [January 30, 2019, 4:07pm UTC](https://community.sonarsource.com/t/when-am-running-sonarcloud-integration-with-vsts-in-code-coverage-section-it-is-showing-0-0-please-help-me-how-to-get-the-report/5244/12 "2019-01-30T16:07:09Z")

</div>

Closed on January 30, 2019, 4:07pm UTC


