Skip to content

Warning "No code coverage data available. Profiler was not initialized." #129

@StefH

Description

@StefH

When running this command in a powershell script:

dotnet-coverage collect -s "codecoverage.xml" -f cobertura -o coverageFile.xml "dotnet test ./MyTest.csproj --no-build --configuration Release --results-directory TestResults --logger trx --collect `"XPlat Code Coverage;Format=cobertura`""

I get a warning: No code coverage data available. Profiler was not initialized. and indeed the coverageFile.xml is empty:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<coverage line-rate="1" branch-rate="1" complexity="1" version="1.9" timestamp="1721989043">
  <packages />
</coverage>

Note that both the project and the testproject are a net6.0 project with RuntimeIdentifier win-x86.

And using a net48 project + test project works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions