Home > Enterprise >  Code Coverage file contains coverage of Irrelevant assemblies does not exclude even exclude with run
Code Coverage file contains coverage of Irrelevant assemblies does not exclude even exclude with run

Time:01-22

The project I am working on has a test project. As part of the test run, It generates a code coverage file. It used the below command to test and generate coverage XML.

dotnet test --collect:"XPlat Code Coverage" --settings .\CodeCoverage.runsettings

The issue is coverage file contains code coverage about Microsoft.IdentityModel.Clients.ActiveDirectory and HtmlAgilityPack other than the project assemblies. So I want to exclude those coverage data from the report and change .runsetting files as below. ( ) But it doesn't work. Here one other things is in Include I only include to have coverage for XXX.Search.dll but coverage include other project assemblies as well.

One other interesting thing I noticed is If I run the dotnet test without having --settings .\CodeCoverage.runsettings It would generate the same report.

I refer all possible options in here but did work for me. enter image description here

  • Related