Generate PDB from .NET DLL file?

ε祈祈猫儿з 提交于 2019-12-02 16:38:53

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

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
Stelio

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.

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":

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...":

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!