Skip to content

Data collection: Could not find data collector 'XPlat Code Coverage" #521

@itsryankwon

Description

@itsryankwon

Hello,

I can't show code due to it being for the company I work for but basically I am getting this error:

Data collection : Could not find data collector 'XPlat Code Coverage'

I saw this error on another post but I don't think my cause is the same.

What I'm doing to get this message:

dotnet vstest Tests.dll --collect:"XPlat Code Coverage" or
dotnet vstest Tests.dll --collect:"XPlat Code Coverage" --settings coverletArgs.runsettings

I tried using the runsettings file as well but that didn't change anything.

Output of dotnet --info:

.NET Core SDK (reflecting any global.json):
  Version:    2.2.401
  Commit:   7299b316c13

Runtime Environment:
  OS Name: centos
  OS Version: 7
  OS Platform: Linux
  RID: centos.7-x64
  Base Path:  /usr/share/dotnet/sdk/2.2.401/

Host (useful for support):
  Version: 2.2.6
  Commit: 7dac9b1b51

.NET Core SDKs installed:
  2.2.401 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.12 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.12 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.12 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.6 /usr/share/dotnet/shared/Microsoft.NETCore.App]

I have the following package references as well in my test projects:

<PackageReference Include="coverlet.collector" Version="1.0.1">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageRefernece Include="MSTest.TestFramework" Version="1.3.2" />

and <TargetFramework>netcoreapp2.2</TargetFramework>

Am I missing something or doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions