Code coverage broken recently #8880

hughbe opened this Issue May 26, 2016 · 8 comments


None yet

6 participants

hughbe commented May 26, 2016 edited

Code coverage doesn't seem to be working anymore (I think after dnxcore50 -> netcoreapp1.0).

Steps to reproduce

  • Clone the repo
  • Initialize build tools
  • Navigate to a test project (e.g. System.Collections.NonGeneric)
  • Run msbuild /T:BuildAndTest /P:Coverage=true


  • ~100% code coverage


  • 0% code coverage reported

/cc @ericstj

@Priya91 Priya91 was assigned by joshfree May 26, 2016
@joshfree joshfree added this to the 1.1.0 milestone May 26, 2016
@stephentoub stephentoub modified the milestone: 1.0.0-rtm, 1.1.0 May 27, 2016

Note that this isn't just when building locally or when building an individual project. Our code coverage reports are all showing as 0% coverage. 😦


@sawilde, does OpenCover have a hard dependency on mscorlib.dll being named "mscorlib"? The core library has been renamed for .NET Core from "mscorlib" to "System.Private.Corelib", and I'm wondering if that change explains why OpenCover is reporting 0 hits on everything.

@joshfree joshfree modified the milestone: 1.1.0, 1.0.0-rtm Jun 2, 2016
joshfree commented Jun 2, 2016

Moving this to 1.1.0. We can fix this in master and then look to port the changes back to 1.0.0, possibly during a servicing event or other related branch maintenance.

sawilde commented Jun 2, 2016

@stephentoub - Alas yes - the cuckoos attach to System.CannotUnloadAppDomainException which it looks for when mscorlib is loaded.

I suspect the change is easy - see - but it depends where you keep that class in your new scheme.

You could try the -oldstyle switch - see Usage but you may have other issues especially around partial trust scenarios.

@sawilde sawilde referenced this issue in OpenCover/opencover Jun 3, 2016

.net core support #595


Thanks, @sawilde. I'll give that a try.


Thanks, @sawilde. The -oldStyle workaround appears to have unblocked us.

@stephentoub stephentoub closed this Jun 3, 2016
sawilde commented Jun 4, 2016

I am so glad I didn't delete that code 3 years ago :)


I am so glad I didn't delete that code 3 years ago :)

Hah :) Me, too.

@StephenCleary StephenCleary added a commit to StephenCleary/BuildTools that referenced this issue Jun 28, 2016
@StephenCleary StephenCleary Update for .NET Core RTM 599beba
@karelz karelz modified the milestone: 1.2.0, 1.1.0 Dec 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment