Skip to content

Instantly share code, notes, and snippets.

@jbevain
Last active August 24, 2023 20:04
  • Star 61 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
pdb2mdb for Visual Studio 2015

The Visual Studio Tools for Unity are able to convert .NET debug symbol files (namely pdb files) to debug symbols files that are understood by Unity's scripting engine (namely .dll.mdb files) when importing both the .dll and the .pdb in the Assets folder.

If you prefer to handle the conversion yourself you need to call a tool named pdb2mdb on the .dll associated with the .pdb:

pdb2mdb MyLibrary.dll

Will produce a MyLibrary.dll.mdb usable on Unity if MyLibrary.pdb is present.

The .pdb files generated by Visual Studio 2015 can contain new informations that are not handled by the pdb2mdb file shipped by Unity.

You can download below the version that VSTU is using which handles the new 2015 format. This executable is self-contained and embeds all the references it needs, namely Mono.Cecil.

License Information:

  • pdb2mdb is licensed under the Microsoft Public License (Ms-PL).
  • Mono.Cecil is licensed under the MIT/X11.
@shravan2x
Copy link

shravan2x commented May 24, 2017

Still works in May 2017 with VS2017 and Mono 5.0.

@jbevain I'm making a quick-n-easy GUI tool for this. Would you be able to update the official pdb2mdb NuGet package?

EDIT: The GUI tool lives at https://github.com/shravan2x/Pdb2Mdb-GUI.

@reyou
Copy link

reyou commented May 28, 2017

For some reason, after re-installing of VS 2017, my pdb2mdb.exe disappeared from C:\ drive. My build was failing. This tool fixed my issue. Thanks!

@dseshadri
Copy link

Could you help me point to the source code from where this version of PDB2MDB was built? I am trying to build the latest version from the mono repository, but i am facing a problem with my version. However, this Executable works great. So, i just need the same version from where this was built.

@benclewett
Copy link

Seems not to work any more. For instance:

mono pdb2mdb.exe Newtonsoft.Json.dll
Fatal error:
System.IndexOutOfRangeException: Array index is out of range.

Or is it just me?

@jbevain
Copy link
Author

jbevain commented Jun 5, 2019

@benclewett, that's probably because of the new portable pdb format. That binary is for the old PDB «native» format.

@tomaszkot
Copy link

I got some hard time trying to get breakpoints working on Unity19.3/VS2017, this exe helped me, thx!

@mokkbs
Copy link

mokkbs commented Aug 17, 2020

I confirm this works with 2017.4.40 and VS 2019

@sdporres
Copy link

sdporres commented Mar 9, 2021

Thank you, this is terrific.

@bodong1987
Copy link

I create a new pdb2mdb, because this pdb2mdb.exe will throw exception in my case( Microsoft.Cci.Pdb.PdbDebugException: Invalid signature. (sig=1919117645) ),
if you have the same exception, you can try this:https://github.com/sczybt/pdb2mdb

@maikgreubel
Copy link

I really appreciate this, thank you.

@Sakyce
Copy link

Sakyce commented Jul 19, 2023

Got a System.OutOfMemoryException :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment