Skip to content
Betim Beja edited this page Jan 20, 2021 · 1 revision

A MSBuild Extension to Generate Coverage with ReportGenerator for Referenced Projects.

This task is intended to work with zero configuration with a PackageReference based project.

  • Add a new project to you solution and change the definition to use Sdk="Microsoft.NET.Sdk" (Enables PackageReferences)
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>   
    <ProjectGuid>{6E7020D4-A279-4D8E-B5D6-DEA31FAEF370}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AssemblyName>AlbanianXrm.EarlyBound.Coverage</AssemblyName>
    <TargetFramework>net462</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="MSBuild.AlbanianXrm.Coverage" Version="1.2021.1.5" />
  </ItemGroup>
</Project> 
  • Add references to the test projects that you want to include in the Coverage Report.
  • Build you project with the Debug configuration to produce the test coverage (the default output is in the bin folder bin$(Configuration)$(TargetFramework)\CoverageReport).

*Default configuration can be overridden using MSBuild properties

Clone this wiki locally