How to keep source code information in generated PDB files?
4hV5t4r4xT Posts: 2 New member
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:
1. SourceLink (https://github.com/dotnet/sourcelink)
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.
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.
0 · Share on Twitter
Thank you for your question. Please can you verify, in your SA project, do you have 'I want to generate the debugging information.' enabled?
yes the "I want to generate the debugging informaton." option is enabled.
The other enabled feature of SmartAssembly is the "Automated Error Reporting".