DotCov 1.0.0

dotnet add package DotCov --version 1.0.0
                    
NuGet\Install-Package DotCov -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DotCov" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotCov" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="DotCov" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DotCov --version 1.0.0
                    
#r "nuget: DotCov, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DotCov@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DotCov&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=DotCov&version=1.0.0
                    
Install as a Cake Tool

Build Coverage

DotCov

Read Cobertura XML from your own code — parse, merge, threshold, and diff coverage reports. Zero package references, Native-AOT clean, and streaming rather than DOM-loading.

Getting started

dotnet add package DotCov
using DotCov;
using DotCov.Formatters;

var inputs = ReportResolver.Resolve("TestResults/");      // file or directory
var report = CoberturaParser.Parse(inputs)
                            .Exclude(ExclusionRules.WellKnown);

Console.WriteLine(TableFormatter.Format(report));

var gate = report.Evaluate(minLinePercent: 80, minBranchPercent: 60);
if (!gate.IsPass)
{
    Console.Error.WriteLine(gate);   // "NODATA: line n/a (min 80%) - …"
    return 1;
}

ReportResolver.Resolve takes a file or a directory; a directory is searched for **/*cobertura*.xml (pass a ReportPattern to change that) and Parse merges every match, so a sharded test matrix needs no merge step. An existing directory with no match yields no inputs and therefore an empty report; a missing path throws.

Two things the API insists on

Rates are double?. null means unanswerable — not 0.0, not 1.0. An empty report has no rate, and treating that as 0% would fail a build that simply measured nothing.

A threshold check has four outcomes, not two. Evaluate returns a GateResult whose Outcome is Pass, Fail, NoData, or Disabled; IsPass covers Pass alone. Branch on the structured flags (LineBelowThreshold, BranchBelowThreshold, IsInconclusive) rather than parsing Reason.

What else is in the box

// Compare two reports — added / removed / modified, per-file deltas, line-level flips
var diff = CoverageDiff.Compare(
    CoberturaParser.Parse(ReportInput.FromFile("before.xml")),
    CoberturaParser.Parse(ReportInput.FromFile("after.xml")));

foreach (var r in diff.Regressions)
    Console.WriteLine($"{r.Path}: {r.Before:P1} → {r.After:P1}");

// Async streaming, cancellable
await using var stream = File.OpenRead("coverage.cobertura.xml");
var report = await CoberturaParser.ParseAsync(stream, ct: cancellationToken);

// Per-method detail — complexity and line hits, the input behind the CRAP gate
var methods = CoberturaParser.ParseMethods(ReportResolver.Resolve("TestResults/"));
// methods.Methods, methods.Warnings, methods.SourceRoots

TableFormatter, MarkdownFormatter, and JsonFormatter render a report for a terminal, a PR comment, or a pipeline. Every numeric rendering is invariant-formatted: 62.0% on every host, never 62,0%. CoverageSnapshot wraps a report with commit, branch, project, timestamp, and a SHA-256 of the source file.

Parsing and safety

CoberturaParser walks the document with XmlReader — no XDocument.Load, no full-DOM allocation, bounded memory. DTDs are prohibited and XmlResolver is null, so there is no XXE or entity-expansion surface, and each file is capped at 50,000,000 characters by default. Raise or remove the cap with the maxChars overloads (0 disables it).

The package has no PackageReferences at all and builds with the trim/AOT analyzers on and warnings as errors, so AOT-cleanliness is enforced by the compiler rather than by convention.

Every public type carries XML docs — read them in IntelliSense or in the source.

Also in this family

DotCov.Tool — the dotcov CLI · DotCov.Fallout — Fallout build component

Feedback

Documentation · Issues · MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on DotCov:

Package Downloads
DotCov.Nuke

NUKE build extension for Cobertura coverage reporting and CI gating. Installation: nuke :add-package DotCov.Nuke Usage in Build.cs: class Build : NukeBuild, ICoverageReport { } Run: nuke ReportCoverage --coverage-min-line 80 --coverage-exclude-generated true

DotCov.Fallout

Fallout build component that merges Cobertura reports, writes a job summary, and fails the build below your line and branch coverage thresholds. Add ICoverageReport and go.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 43 9/18/2026
0.5.0 125 8/21/2026
0.4.0 134 7/18/2026
0.3.1 138 7/18/2026
0.3.0 139 6/11/2026
0.2.0 141 6/11/2026
0.1.4 132 5/31/2026
0.1.3 137 5/30/2026
0.1.2 126 5/16/2026
0.1.1 350 4/8/2026
0.1.0 132 4/8/2026