coverlet: [BUG] 6.0.1 requires dotnetsdk 8 but doesn't say that
Describe the bug Had a build tied to 6.* for a version using sdk 6 and it failed with
Data collector 'XPlat code coverage' message: [coverlet]System.TypeLoadException: Could not load type 'Microsoft.Extensions.DependencyInjection.ServiceCollection' from assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
at Coverlet.Collector.DataCollection.CoverletCoverageCollector.GetDefaultServiceCollection(TestPlatformEqtTrace eqtTrace, TestPlatformLogger logger, String testModule)
at Coverlet.Collector.DataCollection.CoverletCoverageCollector.OnSessionStart(Object sender, SessionStartEventArgs sessionStartEventArgs) in /_/src/coverlet.collector/DataCollection/CoverletCoverageCollector.cs:line 135.
To Reproduce build with dotnet6
Expected behavior Expect coverlet to run and report successfully
Actual behavior fails to generate report
Configuration (please complete the following information): Please provide more information on your .NET configuration: * Which coverlet package and version was used? * reproduceable with 6.0.1 * Which version of .NET is the code running on? * 6.0.x (tried a few versions…all reproduced) * What OS and version, and what distro if applicable? * window 10 and linux ubuntu (whatever azdo is using now a days) * What is the architecture (x64, x86, ARM, ARM64)? * x64 * Do you know whether it is specific to that configuration? * seems not to be
Additional context the changes in this PR https://github.com/coverlet-coverage/coverlet/pull/1601 seems to force having dotnet 8 installed so that thinks like System.Text.Json will load the 8.0 version from the shared framework.
❗ Please also read Known Issues
doesn’t appear to be any
overall, seems like mistake to break backwards compatability between 6.0.0 and 6.0.1 like this…doesn’t seem to match semver…but maybe that was your intent? understand 6 is EOL at end of year so we should be moving to 8 sdk soon…
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 13
- Comments: 24
Commits related to this issue
- revert coverlet to 6.0.0 to fix issue https://github.com/coverlet-coverage/coverlet/issues/1625 — committed to tspascoal/GitHubActions.Gates.Samples by tspascoal 3 years ago
- Split CI into 2 jobs. (#154) * Split CI into 2 jobs. One for build and test and another for codescanning Downgrade coverlet to workaround issue https://github.com/coverlet-coverage/coverlet/issue... — committed to tspascoal/GitHubActions.Gates.Samples by tspascoal 3 years ago
- Revert coverlet.container due to https://github.com/coverlet-coverage/coverlet/issues/1625 — committed to blowdart/idunno.PasswordGenerator by blowdart 3 years ago
@daveMueller
It is working now. Tested with
image: mcr.microsoft.com/dotnet/sdk:6.0andcoverlet.collector --version 6.0.2-preview.8.g892d86e16bWhen do you expect to have a new version released with the issue solved?
I saw now what you mean https://github.com/coverlet-coverage/coverlet/pull/1601/files#diff-1d12ae6a5243ca16cfc9b56abc8423c15a917dd1adcdc3d7dd3482ccff2208da this was wrong… tfm is 6.0 https://github.com/coverlet-coverage/coverlet/pull/1601/files#diff-1d12ae6a5243ca16cfc9b56abc8423c15a917dd1adcdc3d7dd3482ccff2208daL5
@Bertk @daveMueller we cannot declare >= 6.0 and insert non 6 lib…this needs to be fixed.
Same problem here… All our CI pipelines are failing because we are adding coverlet.collector dynamically to our test solutions via dotnet add package.
@Bertk the hello world example still uses
PackageReference Include="coverlet.collector" Version="6.0.0" >=> Version 6.0.0dotnet add package will install version 6.0.1 (a patch update that must not contain breaking changes according to SemVer) and this package does not include any dependency to system.text.json at all.
We now have a new official release
6.0.2that can be consumed from nuget.org.hope we see a release soon
Have same issue. We’re using .NET 6 SDK and have
coverlet.collectorreferenced as6.0.*. Having such a breaking change in a patch version is quite a surprise. Changes described in https://github.com/coverlet-coverage/coverlet/pull/1626 require at least new minor version.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
@Bertk would it be also possible to release 6.0.2 with reverted changes?
IMHO if there is support for .NET 6.0 it now has dependencies. If I have to pin other packages to a specific version for coverlet to be compatible, that package is a depdendency… Therefore, right now my workaround is to pin coverlet to v6.0.0 in all .NET 6 projects.