Skip to content

Allow option to instrument modules for which some source files listed in the associated .pdb file are not present #1193

@wyattm124

Description

@wyattm124

Hello,

Our engineering team has a sizable .dll (***.netstandard.dll sorry the name is redacted for privacy) that we would like to instrument using the coverlet.console.exe. However after we create the .dll using MSBuild, we also repack the .dll with all of its dependencies into one .dll that we release to our customers. When instrumenting this .dll, we come across the following issue :

...
Unable to instrument module: C:\***\bin\Debug\netcoreapp3.1\***.netstandard.dll, pdb without local source files, [C:\Repos\HtmlAgilityPack\HtmlAgilityPack.Shared\crc32.cs]
Instrumented module: 'C:\***\bin\Debug\netcoreapp3.1\***CoreOperations.dll'
...

Our main .dll that we would like to instrument for code coverage cannot be instrumented because the .pdb file associated with the .dll contains references to the Html agility pack .dll (which can be found here : https://www.nuget.org/packages/HtmlAgilityPack/ we use version : 1.11.24) and the source code for this package cannot be found locally. However, for some reason this problem does not occur for us with our dependencies like NLog (which can be found here : https://www.nuget.org/packages/NLog/ , we use version : 4.7.7). Is there a way that we could repack our assembly so that all the required files are available?

Or, could we submit a PR to allow the option to skip verifying that all the source files referenced in a .pdb file are present? We were able to instrument ***.netstandard.dll and receive decent code coverage results by commenting out the use of the PortablePdbHasLocalSource function from the InstrumentationHelper.cs file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionGeneric discussion on somethingfeature-requestNew feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions