From 0eab8f10019d23f05efd83efac10f3a736d0b862 Mon Sep 17 00:00:00 2001 From: Bert Date: Fri, 6 Sep 2024 15:01:17 +0200 Subject: [PATCH 1/2] add known issue BadImageFormatException --- Documentation/KnownIssues.md | 15 +++++++++++++++ README.md | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Documentation/KnownIssues.md b/Documentation/KnownIssues.md index 3218eba29..f91124927 100644 --- a/Documentation/KnownIssues.md +++ b/Documentation/KnownIssues.md @@ -234,3 +234,18 @@ The XML code coverage report is too large for the coverlet to parse. *Potential Solutions:* * Reduce noise from auto generated code, for example excluding your EntityFrameworkCore Migrations namespace or automatically generated typed Http Clients. See [Excluding From Coverage](./MSBuildIntegration.md#excluding-from-coverage) for more information on ignoring namespaces from code coverage. + +## BadImageFormatException .NET Framework 4.7.x, 4.8.x + +*Symptoms:* + +```text +BadImageFormatException during MetadataReaderProvider.FromPortablePdbStream in InstrumentationHelper.PortablePdbHasLocalSource, unable to check if the module has got local source. +``` + +*Solutions:* + +Change [DebugType](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/code-generation#debugtype) from `full` to `portable`. + +>[!IMPORTANT] +>NET Core introduces a new symbol file (PDB) format - portable PDBs. Unlike traditional PDBs which are Windows-only, portable PDBs can be created and read on all platforms. diff --git a/README.md b/README.md index 30cd97528..cea37fcfc 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ | coverlet.msbuild | [![NuGet](https://img.shields.io/nuget/v/coverlet.msbuild.svg)](https://www.nuget.org/packages/coverlet.msbuild/) | [![NuGet](https://img.shields.io/nuget/dt/coverlet.msbuild.svg)](https://www.nuget.org/packages/coverlet.msbuild/) | | coverlet.console | [![NuGet](https://img.shields.io/nuget/v/coverlet.console.svg)](https://www.nuget.org/packages/coverlet.console/) | [![NuGet](https://img.shields.io/nuget/dt/coverlet.console.svg)](https://www.nuget.org/packages/coverlet.console/) | -Coverlet is a cross platform code coverage framework for .NET, with support for line, branch and method coverage. It works with .NET Framework on Windows and .NET Core on all supported platforms. +Coverlet is a cross platform code coverage framework for .NET, with support for line, branch and method coverage. It works with [.NET Framework](Documentation/KnownIssues.md#badimageformatexception-net-framework-47x-48x) on Windows and .NET Core on all supported platforms. **Coverlet documentation reflect the current repository state of the features, not the released ones.** **Check the [changelog](Documentation/Changelog.md) to understand if the documented feature you want to use has been officially released.** From 33dee716e56a0f9258e27d09abc64182ade110af Mon Sep 17 00:00:00 2001 From: Bert Date: Fri, 6 Sep 2024 15:20:13 +0200 Subject: [PATCH 2/2] remove % from title --- Documentation/KnownIssues.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/KnownIssues.md b/Documentation/KnownIssues.md index f91124927..e14c2bfd7 100644 --- a/Documentation/KnownIssues.md +++ b/Documentation/KnownIssues.md @@ -183,7 +183,7 @@ Stack Trace: *Solution:* Looks like this is caused by xUnit's app domains. For `dotnet test`, it can be disabled with the following argument: `-- RunConfiguration.DisableAppDomain=true` -## Code coverage returns NaN% +## Code coverage returns NaN *Symptoms:* You are getting following result when running Coverlet within CI/CD pipeline: