dotnet tool install --global --version 8.6.125
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local --version 8.6.125
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?
nuke :add-package --version 8.6.125

Instrumenting coverage tool for .net (framework 2.0+ and core) and Mono assemblies, reimplemented and extended almost beyond recognition from dot-net-coverage, plus a set of related utilities for processing the results from this and from other programs producing similar output formats.


See the Wiki page for full details

What's in the box?

For Mono, .net framework and .net core, except as noted

  • altcover, a dotnet global tool for recording code coverage (netcoreapp2.1)
  • A PowerShell module for Windows PowerShell 5.1 and PowerShell Core 6+ containing a cmdlet that drives the tool, and other cmdlets for manipulating coverage reports
  • MSBuild tasks to drive the tool, including dotnet test integration (.targets file included, but as a global tool, without the frictionless integration of the core and api packages)

Why altcover?

As the name suggests, it's an alternative coverage approach. Rather than working by hooking the .net profiling API at run-time, it works by weaving the same sort of extra IL into the assemblies of interest ahead of execution. This means that it should work pretty much everywhere, whatever your platform, so long as the executing process has write access to the results file. You can even mix-and-match between platforms used to instrument and those under test.

In particular, while instrumenting .net core assemblies "just works" with this approach, it also supports Mono, as long as suitable .mdb (or .pdb, in recent versions) symbols are available. One major limitation here is that the .mdb format only stores the start location in the source of any code sequence point, and not the end; consequently any nicely coloured reports that take that information into account may show a bit strangely.

Why altcover? -- the back-story of why it was ever a thing

Back in 2010, the new .net version finally removed the deprecated profiling APIs that the free NCover 1.5.x series relied upon. The first version of AltCover was written to both fill a gap in functionality, and to give me an excuse for a ground-up F# project to work on. As such, it saw real production use for about a year and a half, until OpenCover reached a point where it could be used for .net4/x64 work (and I could find time to adapt everything downstream that consumed NCover format input).

Fast forwards to autumn 2017, and I get the chance to dust the project off, with the intention of saying that it worked on Mono, too -- and realise that it's déja vu all over again, because .net core didn't yet have profiler based coverage tools either, and the same approach would work there as well.

Continuous Integration

Build GitHub Build statusBuild history
Test coverage Coveralls Coverage Status

Possible retirement/obsolescence of support

tl;dr -- legacy framework/Mono support is not going away any time soon.

As net472 can consume netstandard2.0 libraries (everything but the recorder), and .net core 2+ can consume net20 libraries (the recorder), legacy framework/Mono support continues until such a time as it is no longer possible to retain those API levels.

Other NuGet Packages in this suite

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
8.6.125 6,823 1/4/2024
8.6.95 4,165 11/14/2023
8.6.68 18,201 7/10/2023
8.6.61 8,639 6/6/2023
8.6.45 7,109 3/21/2023
8.6.40 708 3/16/2023
8.6.14 6,045 1/1/2023
8.5.842 779 12/25/2022
8.5.841 2,845 11/19/2022
8.4.840 1,319 10/17/2022
8.3.839 921 9/13/2022

This build from

Q. Never mind the fluff -- how do I get started?
A. Start with the Quick Start guide : and
read the FAQ :

8.6.125 (Habu series release 25)
• [BUGFIX] Issue 197 : Update [InternalsVisibleTo] references during instrumentation.  Finally fixing an issue that's been there since 2010!

8.6.95 (Habu series release 24)
• Built with and supports net8.0 release
• Other dependency updates.
• Minor housekeeping changes, but no actual new features.

8.6.68 (Habu series release 23)
• Omit anonymous types from coverage, in the same way as other compiler generated code (auto-properties, equality and related operations on F# distributed unions, etc.)
• Supports net8.0 preview 5

8.6.61 (Habu series release 22)
• [BUGFIX] prevent possible "The lists had different lengths." exception in the collect phase (Issue 181)
• Removes some obsolete code from the dotnet test integration
• Drop support for Fake 5.23.x
• Supports net8.0 preview 4
• Updated to Cecil 11.5, removing the need for workrounds for issues noted at 11.4
• Other dependency updates.

8.6.48 (Habu series release 21a)
• [BUGFIX] Correctly package the visualizer for net5.0, as well as building it against the later platform

8.6.45 (Habu series release 21)
• [BUGFIX] Issue #179 - Improve and strengthen the heuristic for locating dependent assemblies, prossibly slightly speeding the look-up in the process by eliminating potentially duplicated effort.

8.6.40 (Habu series release 20)
• [BUGFIX] Issue #178 - possible NRE when instrumenting woven code e.g. using Fody
• [AvaloniaVisualizer] Now requires net5.0 or later
• Supports Fake 6.0.0.  This is probably the last release that will support earlier versions, as 5.23.1 is almost 6 months old.
• Supports net8.0 previews 1,2 (so far, no nasty surprises like with the 7.0.100 release)

8.6.14 (Habu series release 19)
• [GTKVisualizer] Fix an off-by-one crash for coverlet generated files
• [AvaloniaVisualizer] Fix possible crash launching the About dialog
• [Visualizer] Display coverage percentages against nodes of the tree (known issue that the synthetic F# module nodes are not thus decorated)
• [Visualizer] Improve handling of larger coverage files by deferring more processing until the tree model is actually expanded.
• [API] Types Options.CLI, Options.Logging, Options.Prepare and Options.Collect in namespace AltCover; concrete implementations of the ICLIOptions, ILoggingOptions and IPrepareOptions and ICollectOptions respectively, with getter and setter for each property.  Default values for the latter two are as per the corresponding Primitive record types.
• [API] Also on the AltCover.Fake package in the AltCoverFake.DotNet.Testing namespace (except Options.Logging which is not useful in that context)

8.5.842 (Habu series release 18)
• [VISUALIZER] As the relevant Avalonia issue is long resolved, move to having separate dialog boxes for the Avalonia Visualizer's "About" and message box, as in the GTK# version.
• ref struct types have an autogenerated [Obsolete] attribute with a standard comment - detect and ignore such attributes.  See for details.

8.5.841 (Habu series release 17)
• To support Cake 3.0, move the Cake API assembly from AltCover.Api to a new package AltCover.Cake; this contains libraries built against Cake 2.0.0 at netcoreapp3.1 as well as the old ones built against Cake 1.0.0 at netstandard2.0 (present but in practice obsolete).
• Following's policy of deprecating releases older then 6 month, drop support for versions before 5.23
• [BREAKING] Rename AltCover.Cake.DotNet.DotNetCoreTest to AltCover.Cake.DotNet.DotNetTest (even in the obsolete 1.0.0 build) to match the changes in the Cake APIs (and consequent chage to the test setting type in the argument list).  Similarly, in the version >= 2.0.0 build, the type AltCover.Cake.DotNet is now a [CakeAliasCategory("DotNet")] rather than [CakeAliasCategory("DotNetCore")]
• [API] New DotNet APIs for Fake support - ToTestPropertiesList method to emit a list of (name,value) pairs to allow customised property passing to dotnet test in the wake of the v7.0.100 regression.
• [API] Additionally ImportModuleProperties and GetVersionProperties values that are additonal lists of (name,value) pairs to append as needed.

For previous releases (8.4.840 and earlier) go here --