Search code examples
c#dllpdb-files

How can I find the source for a DLL\PDB in C#?


I'm attempting to write a C# application that takes built DLLs & PDBs for managed projects and find all the CS\VB files that were used to compile them for cataloging in a database.

Does anyone know of a library that can be used to find all the original source file paths that were used to build a DLL? ICorDebug might do it, but I can't find where to attach the PDB or get a list of source files.


Solution

  • The Roslyn repo has an app/library called pdb2xml that will list the source files in the PDB.

    https://github.com/dotnet/roslyn/tree/master/src/Tools/Source/Pdb2Xml