question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
petlicommented, Aug 5, 2021

I wrote an issue for a similar problem (#1164) which may also help with your specific problem.

0reactions
MarcoRossignolicommented, Aug 7, 2021

Will close this issue in favor of @petli one https://github.com/coverlet-coverage/coverlet/issues/1164

We can continue the discussion there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No Source Available during Minidump Debugging
I have linked the pdb files in the properties page: Options -> Debugging ... There is always the page - No Source Available...
Read more >
Symbol / PDB files in the Visual Studio debugger
Learn how to configure symbol & source files and how to configure them in the Visual Studio debugger.
Read more >
Customizing Code Coverage Analysis - Visual Studio
Learn how to use the ExcludeFromCodeCoverageAttribute attribute to exclude test code from coverage results. You can include assemblies ...
Read more >
TAU User's Guide - Computer Science - University of Oregon
program that automatically inserts TAU annotations in the source code [PDT-URL]. If PDT is configured with a subdirectory option (-compdir=<opt>) then TAU ...
Read more >
Debug modules that have no debug information (PDB)
With ReSharper, you can debug any compiled module, even if it does not have debug information (PDB). ReSharper will decompile the module, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found