Generate PDB from .NET DLL file?

20,343

Solution 1

You need the source code in order to generate a PDB.

Solution 2

Actually you can do it also with dotPeek from 1.2 version onward.

Right click the assembly in Assembly Explorer, and select "Generate Pdb". It also has the option to generate files for referenced assemblies all at once.

enter image description here

Solution 3

Even you have no sources and code obfuscated, you can create pdb by recompile with ildasm and ilasm:

  • decompile assembly by ildasm: ildasm /out=assembly_name.il assembly_name.dll
  • complile with ilasm: ilasm assembly_name.il /dll /pdb

Solution 4

PDB contains debug symbols related to DLL, and would normally be built together with the DLL. To enable generating pdb files go to project Properties, Build tab, Advanced... button and select in Debug Info field "pdb-only" or "full":

Visual Studio generate PDB

If you need to debug a thirdparty assembly without sources, then dotPeek and ReSharper will be extremely helpful having an option to generate PDB from DLL. In ReSharper, this can be done through ReSharper > Windows > Assembly Explorer by opening necessary assembly and clicking "Generate Pdb...":

Resharper Generate PDB

Solution 5

You can use ILSpy. This is the handy free app for disassembling and generating pdb for managed dll's.

Share:
20,343
BrunoLM
Author by

BrunoLM

I'm a Developer for Fun! Things I like Code Play games Anime / Manga Contact information [email protected] LinkedIn Facebook Site - https://brunolm.github.io/ Blog - http://blog.codingwise.com/

Updated on December 05, 2020

Comments

  • BrunoLM
    BrunoLM over 3 years

    I need something that can generate a PDB from a DLL file (C# .NET code), is there any free program to do that?