coverlet-coverage / coverlet

Cross platform code coverage for .NET
MIT License
2.98k stars 386 forks source link

System.EntryPointNotFoundException : Entry point was not found #1517

Closed sungam3r closed 7 months ago

sungam3r commented 1 year ago

On net6.0 I faced with weird issue. See https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/pull/1980 and especially https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/pull/1980#issuecomment-1666717402 .

I narrowed it down to --collect "XPlat Code Coverage" and opencollector package.

Steps to reproduce:

  1. Check out code from my branch in https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/pull/1980
  2. Run dotnet test ./test/HealthChecks.Gremlin.Tests/HealthChecks.Gremlin.Tests.csproj --collect "XPlat Code Coverage" -f net6.0 locally from the repo root. Test run fails.

Additional notes:

  1. No such error without --collect "XPlat Code Coverage".
  2. No such error if explicitly add <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" /> into test project.
  3. No such error on net7.0.
daveMueller commented 1 year ago

Thanks for reporting 🙏

Bertk commented 1 year ago

@daveMueller I used the latest nightly build and the problem still occurs but this will be solved with PR #1513. Nuget package System.Text.Json V7.0.3 is using Microsoft.Bcl.AsyncInterfaces V7.0.

image
daveMueller commented 1 year ago

@Bertk I just tried it out real quick with our nightly and it seems this is still an issue. Maybe you can double check when you find some time.

Bertk commented 1 year ago

@daveMueller The versions in the nuget package are correct but this will not be available in the bin folder of test project (<PrivateAssets>all</PrivateAssets>). The PackageReferenze should be added to test project test\HealthChecks.Gremlin.Tests\HealthChecks.Gremlin.Tests.csproj

  <ItemGroup>
    <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
  </ItemGroup>

and the System.EntryPointNotFoundException will vanish.

Bertk commented 11 months ago

@sungam3r Please try again with latest version from coverlet-nightly feed e.g. <PackageVersion Include="coverlet.collector" Version="6.0.1-preview.20.g3ec85e7a33" />

Bertk commented 8 months ago

related #1601

sungam3r commented 8 months ago

@Bertk I checked 6.0.1-preview.20.g3ec85e7a33 and see no error.

Bertk commented 7 months ago

coverlet V6.0.1 is released.