Closed joaorosado closed 8 months ago
I got the same issue, interestingly the build worked fine on ubuntu github runner but failed on local builds/tests (on windows)
I believe I have the same issue too:
https://github.com/santisq/PSCompression/actions/runs/8039618762/job/21956826632?pr=22#step:5:49
Thanks a lot for reporting this. I can reproduce it with simply dotnet test /p:CollectCoverage=true
. Repro is attached here.
Issue1629.zip
The same here https://github.com/destructurama/attributed/pull/109
I start working on this and see if I can figure something out.
So the problem only occurs for none-NetCore
projects like in the bug description net472
. As coverlet.core
is now multitarget in version 6.0.1
, msbuild is using the wrong assemblies.
I think the issue is here https://github.com/coverlet-coverage/coverlet/blob/master/src/coverlet.msbuild.tasks/coverlet.msbuild.props#L22-L23. We can't use the MSBuildRuntimeType
for this condition as e.g. on my local this still is Core
.
I see two options here. We could move back to build coverlet.core
only targeting netstandard2.0
. I already tried that out and it is working. Or try to work with some other condition.
cc: @MarcoRossignoli @Bertk
I see two options here. We could move back to build coverlet.core only targeting netstandard2.0. I already tried that out and it is working. Or try to work with some other condition.
I would go for now netstandard2.0
and we will work if needed to multi-tfm but with completely different packaging...like be fair and do not cheat nuget.
I think I would have found a condition that works but keeping it netstandard2.0
for now is fine for me. I'll create a PR.
I'm getting a similar error with net7.0-windows
. It attempts to load System.Collections.Immutable, Version=8.0.0.0
. There are no errors with coverlet.collector 6.0.0
Hi guys, we finally merged everything we broke with the last release. We would really appreciate if someone could give it a try. Here is how to consume the nightly: https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/ConsumeNightlyBuild.md
We now have a new official release 6.0.2
that can be consumed from nuget.org.
Thank you.
Describe the bug After upgrading from 6.0.0 to 6.0.1 the tests fail with errors initializing Coverlet
To Reproduce Updated from 6.0.0 to 6.0.1. Project being tested targets netstandard2.0. Only external reference is Newtonsoft.Json 13.0.3 Test project targets 4.7.2 and has the following references:
Expected behavior Tests to run without crashing
Actual behavior
Configuration (please complete the following information): Please provide more information on your .NET configuration:
Additional context Current command being used to execute the tests:
dotnet test D:\a\1\s\tests\UnitTests\Auditing.Tests --configuration Release --no-restore --no-build --logger trx --framework net472 /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:ExcludeByFile=*/GitVersionInformation. /p:CoverletOutput=D:\a\TestResults\coverage.net472.1.xml
Currently I'm not able to switch execution mode to the --collect version due to the test CI templates being shared by all our or organizational repositories. So cannot test with the --collect:"XPlat Code Coverage" option