-
Notifications
You must be signed in to change notification settings - Fork 389
Incompatibility with xunit and netfx #338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Just ran into this myself. I have .Net Core project using net462 with xunit 2.4.1 as my test framework. I tried both workarounds, but still get the same exact error. If I take out ref to xunit.runner.visualstudio, it will produce a coverage file, but then says there are no test in the project and the code coverage file is all zeros. |
@eMarkM Not sure if it helps, but when I first downgraded, I ran into the issue, but something was still cached. I had to removed the |
yeah, I got it to work finally with /p:Exclude="[xunit.]" flag. Thanks. |
- Left coverlet.msbuild at 2.3.2 due to a compatibility issue with xunit coverlet-coverage/coverlet#338.
Problem
When working with a netfx project that uses
xunit
,dotnet test
with coverlet fails with the following error:dotnet test coverlet.diag.unittests/coverlet.diag.unittests.csproj /p:CollectCoverage=true
Environment
winver
:Windows 10 Version 1607 (OS Build 14393.2724)
dotnet --version
:2.1.503
Troubleshooting
net471
, but seems to be consistent withnet461
and up.coverlet.msbuild
beyond2.4.0
.Replication
I created a sample repo which fails when tests are run with coverage
git clone https://github.com/tasadar2/coverlet.diag coverlet.diag cd coverlet.diag
dotnet test coverlet.diag.unittests/coverlet.diag.unittests.csproj /p:CollectCoverage=true
Workarounds
Exclude the xunit runner, or all xunit assemblies during test(I would think it would do this anyway since there are no pdbs in the nuget package)
Downgrade to
2.4.0
dotnet add coverlet.diag.unittests\coverlet.diag.unittests.csproj package coverlet.msbuild --version 2.4.0
The text was updated successfully, but these errors were encountered: