Skip to main content

Posts

Showing posts from August, 2022

Publish .NET Core Code Coverage in Azure DevOps

  Publishing .NET Core code coverage in Azure Devops with .Net 6 gives very insightful information and does not require a lot of effort. Add the extension for Report Generator from the market place. Add the coverlet.collector NuGet package to (each of) the test project(s) that you run dotnet test against.  For example: <PackageReference Include=”coverlet.collector” Version=”3.1.0"> <IncludeAssets>      runtime;build;native;contentfiles;analyzers;buildtransitive; </IncludeAssets> <PrivateAssets>all</PrivateAssets> </PackageReference> 3. Next, update the pipeline yaml to ensure your dotnet test command looks like below along with the report generator task to combine the generated coverage reports for all the test projects and then publish the report. # This sets the variable to disable automatic generation of default coverage report and will allow us to use the new report that we are generating via Report Generator - task:...