Skip to content

Could not find data collector 'XPlat Code Coverage' when targetting .dll #1118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
captainjono opened this issue Mar 8, 2021 · 4 comments
Closed
Labels
as-designed Expected behaviour tracking-external-issue The issue is caused by external problem - nothing we can do to fix it directly

Comments

@captainjono
Copy link

> dotnet add package coverlet.collector
dotnet test my.csproj --collect:\"XPlat Code Coverage\" works. great!

dotnet test bin/debug/netcoreapp3.1/test.dll --collect:\"XPlat Code Coverage\"

Data collection : Unable to find a datacollector with friendly name 'XPlat Code Coverage'.
Data collection : Could not find data collector 'XPlat Code Coverage'

What am i missing here? Im writing a tool that integrates with coverage so i would like to support both scenarios.

dotnet --version = 5.0.101

@MarcoRossignoli
Copy link
Collaborator

Can you try with

dotnet vstest bin/debug/netcoreapp3.1/test.dll --collect:\"XPlat Code Coverage\"

As explained in guide for published project https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md

@MarcoRossignoli MarcoRossignoli added the waiting for customer Waiting for customer action label Mar 16, 2021
@captainjono
Copy link
Author

captainjono commented Mar 24, 2021 via email

@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Mar 24, 2021

It's an implementation detail of test platform, we don't load collectors we implement one, you should open an issue and ask here https://github.com/microsoft/vstest/issues

@MarcoRossignoli MarcoRossignoli added as-designed Expected behaviour tracking-external-issue The issue is caused by external problem - nothing we can do to fix it directly and removed waiting for customer Waiting for customer action labels Mar 24, 2021
@RussKie
Copy link

RussKie commented Jan 30, 2023

The solution is described here: #521 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
as-designed Expected behaviour tracking-external-issue The issue is caused by external problem - nothing we can do to fix it directly
Projects
None yet
Development

No branches or pull requests

3 participants