Skip to content

When using .NET 6 (with .NET 8 installed) picking wrong version of System.Text.Json [BUG] #1639

@clinington

Description

@clinington

Describe the bug
So I have both sdks installed, i have a global json pinning the version to 6.0.419.

The version of coverlet.collector is 6.0.1.

Running:

dotnet test --configuration Release --filter Category!=Manual --logger trx --collect:"XPlat Code Coverage;Format=opencover,cobertura"

gets this result:

Data collector 'XPlat code coverage' message: [coverlet]System.IO.FileLoadException: Could not load file or assembly 'System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621)

However, if you switch coverlet.collector to version 6.0.0 and run the same command again then the issue goes away - assuming that it has something to do with the switch from newtonsoft to system.text.json

❗ Please also read Known Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions