coverlet
coverlet copied to clipboard
[BUG] Including the Sentry.AspNetCore package prevents coverage collection
Describe the bug The moment I reference the Sentry.AspNetCore package in my test subject project i get no coverage information whatsoever (specifically Sentry.AspNetCore version 5.5.0). I did not configure the package in any way, nor did i reference it in code. Just including the package reduced my coverage report from a couple hundred KB to an empty report.
To Reproduce
- have a project and a xUnit test project for that project
- observe that coverage collection works normally
- include
<PackageReference Include="Sentry.AspNetCore" Version="5.5.0" />this package reference - observe that coverage no longer works
Expected behavior I expect the coverage collection to not be influenced by that.
Actual behavior Coverage collection outputs this:
<coverage line-rate="0" branch-rate="0" version="1.9" timestamp="1743637253" lines-covered="0" lines-valid="0" branches-covered="0" branches-valid="0">
<sources/>
<packages/>
</coverage>
Configuration (please complete the following information): Please provide more information on your .NET configuration: * Which coverlet package and version was used? 6.0.4 * Which version of .NET is the code running on? 10.0.100-preview.2.25164.34 * What OS and version, and what distro if applicable? Win11 24H2 x86_64 and Ubuntu 24.04.2 LTS aarch64 and Alpine Linux 3.21 aarch64 * What is the architecture (x64, x86, ARM, ARM64)? x64 and ARM64 in the above configurations * Do you know whether it is specific to that configuration? I assume it is not, tested on very different platforms.
:exclamation: Please also read Known Issues
Thank you for bringing this to our attention.
I guess this is a nuget package version conflict. The nuget Sentry.AspNetCore 5.5.0 package supports net8.0 and net9.0. Please use diagnostic logging and check the log file for any exception „unable to load assembly …“ or AssemblyResolutionException.
dotnet test --collect:"XPlat Code Coverage" --diag:log.txt