How to keep source code information in generated PDB files?

We use SmartAssembly to add CrashReporting to our software.
We also have a watchdog which monitors the application, to be able to diagnoes deadlocks.
If the application/ui is unresponsive for too long, the watchdog will create a minidump and send it to us.

You application build by a Build Server which saves all the pdbs on a network share.
We have added this network share as a Symbols location in Visual Studio.
When we analyze a mini dump, we simply open it in Visual Studio and start "debugging". Visual Studio will than load the needed Symboles files from the network share.

If Information about the source code is included in the PDBs Visual Studio will than directly show the source code from which the Assemblies where compiled.

But if we use SmartAssembly to add the CrashReporting and generate new PDBs there is no information about the source code in the PDBs.

We have tried two options for including source information in PDBs:
  This will add a mapping between SourceCode paths and a Url, which is then used to retrieve the source code.
  After compiling the pdb includes a CustomDebugInformation entry for the SourceLink information.
  But after we run SmartAssembly the CustomDebugInformation entry is missing.

2. EmbedAllSources
  For this we only need to add "<EmbedAllSources>True</EmbedAllSources>" into a PropertyGroup of the project file.
  This will as the name says embed all the source files in the PDB.
  After compiling the PDB includes CustomDebugInformationEntries for each source file and the content for the source files are stored as blobs.
  But after running SmartAssembly the CustomDebugInformation entries and blobs are missing. 

Is there any way to keep the information about the source code when using Smart Assembly?

At the moment we need to manually locate the binaries used to generate the mini dump and use a decompiler to be able to debug.
This adds complexity to our process and does not always work because some assemblies just cannot be decompiled correctly.


Sign In or Register to comment.