Newtonsoft.Json 12.0.1 not working with run setting code coverage exclude values

Viewed 362

I have just now updated my project from NewtonSoft 11.0.2 to 12.0.1 and my code coverage has started showing Newtonsoft.Json.dll in coverage report. Obviously I don't want this to happen so I added runsettings exclude setting as shown below.

<ModulePath>Newtonsoft.Json.dll</ModulePath>

But this setting isn't working, other same excludion seeting for other 3rd party dll's are working fine.

When I revert back to NewtonSoft 11.0.2 then code coverage doesn't show Newtonsoft.Json.dll

Not sure what's happening here.

please guide.

Thanks

1 Answers

Try specifying the exclusion like this:

<ModulePath>.*Newtonsoft\.Json\.dll</ModulePath>

I think the reason Newtonsoft.Json.dll shows up in the coverage report is the following PR: https://github.com/JamesNK/Newtonsoft.Json/pull/1746

The build output now contains the Newtonsoft.Json.pdb file which causes the code coverage report to pick up library code as well.

Related