You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configuration (please complete the following information):
Please provide more information on your .NET configuration:
* Which coverlet package and version was used? 6.0.0
* Which version of .NET is the code running on? net8.0
* What OS and version, and what distro if applicable? Win11
* What is the architecture (x64, x86, ARM, ARM64)? x64
* Do you know whether it is specific to that configuration? No
Additional context
log.datacollector contains the following exception
TpTrace Information: 0 : 35584, 1, 2024/12/13, 18:07:37.009, 629740483105, datacollector.dll, AssemblyResolver.OnResolve: Resolved assembly: Microsoft.DotNet.PlatformAbstractions, from path: C:\Users\admin\.nuget\packages\coverlet.collector\6.0.0\build\netstandard1.0\Microsoft.DotNet.PlatformAbstractions.dll
TpTrace Verbose: 0 : 35584, 1, 2024/12/13, 18:07:37.012, 629740517319, datacollector.dll, [coverlet]AspNetCoreSharedFrameworkResolver search paths:
TpTrace Verbose: 0 : 35584, 1, 2024/12/13, 18:07:37.012, 629740517703, datacollector.dll, [coverlet]C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All\9.0.0
TpTrace Verbose: 0 : 35584, 1, 2024/12/13, 18:07:37.012, 629740517868, datacollector.dll, [coverlet]C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\9.0.0
TpTrace Verbose: 0 : 35584, 1, 2024/12/13, 18:07:37.013, 629740524572, datacollector.dll, [coverlet]Loading D:\Projects\Sandbox\Testcoverage\Testsnet8\bin\Debug\net8.0\testsnet8.deps.json
TpTrace Warning: 0 : 35584, 1, 2024/12/13, 18:07:37.017, 629740570341, datacollector.dll, [coverlet]Unable to instrument module: D:\Projects\Sandbox\Testcoverage\Testsnet8\bin\Debug\net8.0\ProjNet8.dll
Coverlet.Core.Exceptions.CecilAssemblyResolutionException: AssemblyResolutionException for 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. Try to add <PreserveCompilationContext>true</PreserveCompilationContext> to test projects </PropertyGroup> or pass '/p:CopyLocalLockFileAssemblies=true' option to the 'dotnet test' command-line
---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
--- End of inner exception stack trace ---
at Coverlet.Core.Instrumentation.NetstandardAwareAssemblyResolver.TryWithCustomResolverOnDotNetCore(AssemblyNameReference name) in /_/src/coverlet.core/Instrumentation/CecilAssemblyResolver.cs:line 215
at Coverlet.Core.Instrumentation.NetstandardAwareAssemblyResolver.Resolve(AssemblyNameReference name) in /_/src/coverlet.core/Instrumentation/CecilAssemblyResolver.cs:line 127
at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
at Mono.Cecil.ModuleDefinition.Resolve(TypeReference type)
at Mono.Cecil.TypeReference.Resolve()
at Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
at Mono.Cecil.MetadataBuilder.GetConstantType(TypeReference constant_type, Object constant)
at Mono.Cecil.MetadataBuilder.AddConstant(IConstantProvider owner, TypeReference type)
at Mono.Cecil.MetadataBuilder.AddField(FieldDefinition field)
at Mono.Cecil.MetadataBuilder.AddFields(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddTypes()
at Mono.Cecil.MetadataBuilder.BuildTypes()
at Mono.Cecil.MetadataBuilder.BuildModule()
at Mono.Cecil.MetadataBuilder.BuildMetadata()
at Mono.Cecil.ModuleWriter.<>c.<BuildMetadata>b__2_0(MetadataBuilder builder, MetadataReader _)
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata)
at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters)
at Coverlet.Core.Instrumentation.Instrumenter.InstrumentModule() in /_/src/coverlet.core/Instrumentation/Instrumenter.cs:line 333
at Coverlet.Core.Instrumentation.Instrumenter.Instrument() in /_/src/coverlet.core/Instrumentation/Instrumenter.cs:line 149
at Coverlet.Core.Coverage.PrepareModules() in /_/src/coverlet.core/Coverage.cs:line 135
Including <PreserveCompilationContext>true</PreserveCompilationContext> and CopyLocalLockFileAssemblies do not make any effect.
Describe the bug
Please share a clear and concise description of the problem.
To Reproduce
Expected behavior
Coverage report includes types from analyzed project.
Actual behavior
Coverage report is empty.
Configuration (please complete the following information):
Please provide more information on your .NET configuration:
* Which coverlet package and version was used?
6.0.0
* Which version of .NET is the code running on?
net8.0
* What OS and version, and what distro if applicable?
Win11
* What is the architecture (x64, x86, ARM, ARM64)?
x64
* Do you know whether it is specific to that configuration?
No
Additional context
log.datacollector contains the following exception
Including
<PreserveCompilationContext>true</PreserveCompilationContext>
andCopyLocalLockFileAssemblies
do not make any effect.Workaround
<PreserveCompilationContext>true</PreserveCompilationContext>
The text was updated successfully, but these errors were encountered: