Loic.danielpalme.ReportGenerator 1.0.0

dotnet add package Loic.danielpalme.ReportGenerator --version 1.0.0
                    
NuGet\Install-Package Loic.danielpalme.ReportGenerator -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="Loic.danielpalme.ReportGenerator" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Loic.danielpalme.ReportGenerator" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Loic.danielpalme.ReportGenerator" />
                    
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 Loic.danielpalme.ReportGenerator --version 1.0.0
                    
#r "nuget: Loic.danielpalme.ReportGenerator, 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.
#addin nuget:?package=Loic.danielpalme.ReportGenerator&version=1.0.0
                    
Install Loic.danielpalme.ReportGenerator as a Cake Addin
#tool nuget:?package=Loic.danielpalme.ReportGenerator&version=1.0.0
                    
Install Loic.danielpalme.ReportGenerator as a Cake Tool

<h1 align="center">

<img src="https://raw.githubusercontent.com/danielpalme/ReportGenerator/master/docs/resources/logo_512.png" alt="ReportGenerator" width="256"/> <br/> ReportGenerator </h1>

<div align="center">

<b>Powerful code coverage visualization</b>

GitHub license CI-CD

</div>

ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.

The reports do not only show the coverage quota, but also include the source code and visualize which lines have been covered.

ReportGenerator supports merging several reports into one.

<div align="center">

Input and output

</div>

License

Getting started

ReportGenerator is a commandline tool which works with full .NET Framework and .NET Core.
Use the online configuration tool to get started quickly.

Install the package matching your platform and needs

Package Platforms Installation/Usage
ReportGenerator<br/><br/>NugetNuget .NET Core 2.x, 3.x, 5.x<br/>.NET Framework 4.7 Use this package if your project is based on .NET Framework or .NET Core and you want to use ReportGenerator via the command line or a build script.<br/><br/>Usage<br/>dotnet $(UserProfile).nuget\packages\reportgenerator\x.y.z\tools\net5.0\ReportGenerator.dll [options]<br/>$(UserProfile).nuget\packages\reportgenerator\x.y.z\tools\net5.0\ReportGenerator.exe [options]<br/><br/>$(UserProfile)\.nuget\packages\reportgenerator\x.y.z\tools\net47\ReportGenerator.exe [options]
dotnet-reportgenerator-globaltool<br/><br/>NugetNuget .NET Core 2.1, 3.x, 5.x Use this package if your project is based on .NET Core and you want to use ReportGenerator as a (global) 'DotnetTool'.<br/><br/>Installation<br/>dotnet tool install -g dotnet-reportgenerator-globaltool<br/><br/>dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools<br/><br/>dotnet new tool-manifest<br/>dotnet tool install dotnet-reportgenerator-globaltool<br/><br/>Usage<br/>reportgenerator [options]<br/>tools\reportgenerator.exe [options]<br/>dotnet reportgenerator [options]
ReportGenerator.Core<br/><br/>NugetNuget .NET Standard 2.0 Use this package if you want to write a custom plugin for ReportGenerator or if you want to call/execute ReportGenerator within your code base.<br/><br/>Plugin development<br/>Custom reports<br/>Custom history storage
Azure DevOps extension<br/><br/>Visual Studio Marketplace VersionVisual Studio Marketplace Installs - Azure DevOps Extension .NET Core >=2.1 Add the Azure DevOps extension to your build pipeline.<br />Learn more
GitHub Actions .NET Core >=2.1 Add the GitHub Action to your build pipeline.<br />Learn more

Usage / Command line parameters

Parameters:
    ["]-reports:<report>[;<report>][;<report>]["]
    ["]-targetdir:<target directory>["]
    [["]-reporttypes:<Html|HtmlSummary|...>[;<Html|HtmlSummary|...>]["]]
    [["]-sourcedirs:<directory>[;<directory>][;<directory>]["]]
    [["]-historydir:<history directory>["]]
    [["]-plugins:<plugin>[;<plugin>][;<plugin>]["]]
    [["]-assemblyfilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]
    [["]-classfilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]
    [["]-filefilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]
    [["]-verbosity:<Verbose|Info|Warning|Error|Off>["]]
    [["]-title:<title>["]]
    [["]-tag:<tag>["]]

Explanations:
   Reports:            The coverage reports that should be parsed (separated by semicolon).
                       Globbing is supported.
   Target directory:   The directory where the generated report should be saved.
   Report types:       The output formats and scope (separated by semicolon).
                       Values: Badges, Clover, Cobertura, CsvSummary, MarkdownSummary, Html, HtmlChart, HtmlInline, 
                       HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary,
                       JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary,
                       TextSummary, Xml, XmlSummary
   Source directories: Optional directories which contain the corresponding source code (separated by semicolon).
                       The source directories are used if coverage report contains classes without path information.
                       Globbing is not supported.
   History directory:  Optional directory for storing persistent coverage information.
                       Can be used in future reports to show coverage evolution.
   Plugins:            Optional plugin files for custom reports or custom history storage (separated by semicolon). 
   Assembly filters:   Optional list of assemblies that should be included or excluded in the report.
   Class filters:      Optional list of classes that should be included or excluded in the report.
   File filters:       Optional list of files that should be included or excluded in the report.
                       Exclusion filters take precedence over inclusion filters.                      
                       Wildcards are allowed.
   Verbosity:          The verbosity level of the log messages.
                       Values: Verbose, Info, Warning, Error, Off
   Title:              Optional title.
   Tag:                Optional tag or build version.

Default values:
   -reporttypes:Html
   -assemblyfilters:+*
   -classfilters:+*
   -filefilters:+*
   -verbosity:Info

Examples:
   "-reports:coverage.xml" "-targetdir:C:\report"
   "-reports:target\*\*.xml" "-targetdir:C:\report" -reporttypes:Latex;HtmlSummary -title:IntegrationTest -tag:v1.4.5
   "-reports:coverage1.xml;coverage2.xml" "-targetdir:report" "-sourcedirs:C:\MyProject" -plugins:CustomReports.dll
   "-reports:coverage.xml" "-targetdir:C:\report" "-assemblyfilters:+Included;-Excluded.*"
.netconfig support

All the above parameters can also be persisted in a .netconfig file, under a [ReportGenerator] section. Examples:

[ReportGenerator]
	reports = coverage.xml
	targetdir = "C:\\report"
	reporttypes = Latex;HtmlSummary
	assemblyfilters = +Test;-Test
	classfilters = +Test2;-Test2

All the plural options can also be specified as multiple singular entries, like:

[ReportGenerator]
	report = coverage1.xml
	report = coverage2.xml
	reporttype = Latex
	reporttype = HtmlSummary
	assemblyfilter = +Test
	assemblyfilter = -Test
	classfilter = +Test2
	classfilter = -Test2
	filefilter = +cs
	filefilter = -vb
	sourcedir = src
	sourcedir = test

Adding/removing values is trivial using the dotnet-config CLI:

# set a single-valued variable
dotnet config reportgenerator.reporttypes Latex;HtmlSummary
# add to multi-valued variable
dotnet config --add reportgenerator.report coverage3.xml
# clear all multi-valued entries for a variable
dotnet config --unset-all reportgenerator.assemblyfilter

Of course it's equally trivial to just edit the .netconfig file by hand.

MSBuild

A MSBuild task also exists:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Coverage" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
  <ItemGroup>
    <PackageReference Include="ReportGenerator" Version="x.y.z" />
  </ItemGroup>
  <Target Name="Coverage">
    <ItemGroup>
      <CoverageFiles Include="OpenCover.xml" />
    </ItemGroup>
    <ReportGenerator ProjectDirectory="$(MSBuildProjectDirectory)" ReportFiles="@(CoverageFiles)" TargetDirectory="report" ReportTypes="Html;Latex" HistoryDirectory="history" Plugins="CustomReports.dll" AssemblyFilters="+Include;-Excluded" VerbosityLevel="Verbose" />
  </Target>
</Project>

The MSBuild task parameters can be complemented with the .netconfig, if used. That means that parameters can be omitted if they are provided via .netconfig, which is useful when reusing fixed settings across multiple projects in a solution, where the MSBuild task is only provided the dynamic values for the current project:

Given the following .netconfig:

[ReportGenerator]
  reporttypes = Html;Latex
  targetdirectory = report
  historydirectory = history
  assemblyfilters = +Include;-Excluded
  verbosityLevel = Verbose

The above target could be simplified as:

  <Target Name="Coverage">
    <ItemGroup>
      <CoverageFiles Include="OpenCover.xml" />
    </ItemGroup>
    <ReportGenerator ProjectDirectory="$(MSBuildProjectDirectory)"
                     ReportFiles="@(CoverageFiles)" 
                     Plugins="CustomReports.dll" />
  </Target>

Supported input and output file formats

ReportGenerator supports several input and output formats.
The wiki explains the different output formats or you can download sample reports of all formats.
If you need a custom format, you can create a plugin.

Input formats Output formats
<ul><li>OpenCover (Nuget)<br/>OpenCover format is also generated by coverlet and altcover</li><li>dotCover (Nuget, /ReportType=DetailedXML)</li><li>Visual Studio (vstest.console.exe, CodeCoverage.exe)</li><li>NCover (tested version 1.5.8, other versions may not work)</li><li>Cobertura</li><li>JaCoCo</li><li>Clover</li><li>Mono (mprof-report)</li><li>gcov</li><li>lcov</li></ul><br/> <ul><li>Html, HtmlSummary, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlChart, MHtml</li><li>Clover</li><li>Cobertura</li><li>SonarQube</li><li>TeamCitySummary</li><li>lcov</li><li>Xml, XmlSummary</li><li>JsonSummary</li><li>Latex, LatexSummary</li><li>TextSummary</li><li>CsvSummary</li><li>MarkdownSummary</li><li>PngChart</li><li>Badges</li><li>Custom reports</li></ul>

Screenshots

The screenshots show two snippets of the generated reports: Screenshot 1 Screenshot 2

Badges
Badges in SVG and PNG format can be generated if -reporttypes:Badges is used:

Sample badge

Resources

Visual Studio extensions

The following extensions exist to visualize coverage in Visual Studio: | Name | Coverage tool | Links | Comment | |:---------|:------------------|:----------|:------------| | AxoCover | OpenCover| GitHub<br/>Marketplace | VS 2019 is not supported | | FineCodeCoverage | coverlet, OpenCover | GitHub<br/>Marketplace | | | RunCoverletReport | coverlet | GitHub<br/>Marketplace | |

Download statistics

Nuget Nuget Nuget Nuget

Visual Studio Marketplace Installs - Azure DevOps Extension GitHub All Releases Chocolatey

Nuget downloads
GitHub stars

Contact

Author: Daniel Palme
Blog: www.palmmedia.de
Twitter: @danielpalme

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 1 7/31/2021