1

We have a .net core 3.1 app that we publish in 3 different ways:

1) dotnet publish <projectname> -c $(BuildConfiguration) -o $(Build.SourcesDirectory)/Source/bin/$(BuildConfiguration)/Agent_windows_core31 -r win-x86 --self-contained false

2) dotnet publish <projectname> -c $(BuildConfiguration) -o $(Build.SourcesDirectory)/Source/bin/$(BuildConfiguration)/Agent_windows -r win-x86 --self-contained

3) dotnet publish <projectname> -c $(BuildConfiguration) -o $(Build.SourcesDirectory)/Source/bin/$(BuildConfiguration)/Agent_portable_core31 --self-contained false

My question is: can we use any of the .pdb files from the output folder, of any of these 3 publish commands, to successfully debug a memory dump from any of the 3 binaries?

For instance, if I am executing dot <binaryname>.dll on the portable agent and take a memory dump of it, and use the .pdb files from the non self-contained win-x86 output, would I be able to debug the memory dump?

I have run Beyond Compare on the .pdb files across all three of these publishing profiles, and the .pdb for both the the win-x86 profiles were identical, but those 2 versus the portable profile there is a small difference. It seems to be only some sort of metadata, but I am not sure.

Irf
  • 4,285
  • 3
  • 36
  • 49
Choub890
  • 1,163
  • 1
  • 13
  • 27
  • 4
    I would only ever use the PDB belonging to a particular build. There's no reason not to. –  Mar 12 '20 at 14:45
  • 2
    The small difference is the important part, that's what a debugger uses to verify that the PDB file matches the program you're debugging. Some debuggers allow forcing a match in spite of the difference, the subject of [this Q+A](https://stackoverflow.com/questions/744870/how-can-you-change-an-age-mismatched-pdb-to-match-properly). – Hans Passant Mar 12 '20 at 14:48
  • 2
    The entire .pdb file is "metadata" :) – Kuba hasn't forgotten Monica Mar 12 '20 at 14:56

0 Answers0