question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Coverage is overwritten if the project has multiple target frameworks

See original GitHub issue

If a system under test has multiple target frameworks, then

dotnet test /p:CollectCoverage=true

runs multiple coverage runs, overwriting the coverage output each time.

This is the equivalent of AltCover issue #31.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
viceicecommented, Jan 24, 2019

Our workaround is to use merging and two output formats:

/p:CollectCoverage=true /p:CoverletOutput=./TestResults/ /p:CoverletOutputFormat=\"json,cobertura\" /p:MergeWith=./TestResults/coverage.json

3reactions
jherby2kcommented, Oct 15, 2018

Workaround is just to run dotnet test with -f <framework>, grab the coverage.xml, then run it again with -f <other_framework>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple target framework project: different versions of the ...
A simple way to do it is to add the <PackageReference ...> nodes conditionally: <ItemGroup> <!-- .
Read more >
Targeting multiple versions of the .NET Framework from ...
The new exception management library I've been working on was originally targeted for .NET 4.6, changing to .NET 4.5.2 when I found that ......
Read more >
Support multiple .NET Framework versions in your project file
Description of the various methods to target multiple .NET Framework versions from within a single NuGet package in your project file.
Read more >
ReSharper, .NET Core and unit testing
Given a project with multiple target frameworks, ReSharper will maintain a separate tree of test classes and methods for each target framework, ...
Read more >
Compliance frameworks | GitLab
You can create a compliance framework that is a label to identify that your project has certain compliance requirements or needs additional oversight....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found