Skip to content

[coverlet] Unable to instrument module - NET 5 - Microsoft.Extensions.Logging.Abstractions #1231

@304NotModified

Description

@304NotModified

For some test projects, but not all, we get

/home/AzDevOps/.nuget/packages/coverlet.msbuild/3.1.0/build/coverlet.msbuild.targets(39,5): warning : [coverlet] Unable to instrument module: MyApi.dll because : AssemblyResolutionException for 'Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. Try to add to test projects or pass '/p:CopyLocalLockFileAssemblies=' option to the 'dotnet test' command-line

Tried:

  • Adding <PreserveCompilationContext>true</PreserveCompilationContext> to csprojs
  • Also pass /p:CopyLocalLockFileAssemblies=true to dotnet test
  • Included a package reference to Microsoft.Extensions.Logging.Abstractions directly in the test projects.
  • upgrade coverlet from 3.0.3 to 3.1.0

Related:

PS I hope this helps to diagnose the issue #1196. I have run more than 10 builds (with 10 tries), but all have the same issue :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reproNeeds repro to be investigated, cannot repro in local

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions