Skip to content

Instantly share code, notes, and snippets.

@jbevain
Last active November 16, 2023 12:11
Show Gist options
  • Save jbevain/ba23149da8369e4a966f to your computer and use it in GitHub Desktop.
Save jbevain/ba23149da8369e4a966f to your computer and use it in GitHub Desktop.
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.
@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.

Copy link

ghost commented Jul 19, 2023

Got a System.OutOfMemoryException :(

@StudioLE
Copy link

Modern C# projects will generate a portable .pdb file which isn't compatible with pdb2mdb to generate the old full .pdb format add the following to your .csproj

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
  <DebugType>Full</DebugType>
</PropertyGroup>

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