Search Unity

Unity 5 and pdb2mdb.exe

Discussion in 'Scripting' started by Leslie-Young, Mar 5, 2015.

  1. Leslie-Young

    Leslie-Young

    Joined:
    Dec 24, 2008
    Posts:
    1,148
    Pretty much what was posted in this thread ("You have insufficient privileges to reply here." - thus this new topic).

    I've tried all the pdb2mdb.exe's I could find under the Unity 5 install but they either crash or generate no .mdb.

    Luckily I still got 4.6 so for now I am using [\Editor\Data\MonoBleedingEdge\lib\mono\4.0\pdb2mdb.exe]

    but ya.. guess the Unity 5 one needs some fixing?
     
  2. Leslie-Young

    Leslie-Young

    Joined:
    Dec 24, 2008
    Posts:
    1,148
  3. Leslie-Young

    Leslie-Young

    Joined:
    Dec 24, 2008
    Posts:
    1,148
    Guess I should post this here too in case someone happens on this thread. After the release of Unity 5.3 I thought I should try updating my post-build command lines. I found a way to call the pdb2mdb which looks something like this

    "C:\Program Files\Unity\Editor\Data\MonoBleedingEdge\bin\cli.bat" "C:\Program Files\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.5\pdb2mdb.exe" "path_to_dll.dll"


    But, I wanted to start using Visual Studio 2015, rather than 2013, and that lead to a new error,

    Microsoft.Cci.Pdb.PdbDebugException: Unknown custom metadata item kind: 7

    I finally found a solution which seems to work when building DLLs with Visual Studio 2015 to generate the MDB so that I get line numbers for error messages in the console.

    Get latest Mono, install it and ....

    "C:\Program Files (x86)\Mono\bin\pdb2mdb.bat" "path_to_some.dll"

    or here is an example from one of my Visual Studio projects' post-build event command lines

    echo f | xcopy "$(TargetPath)" "D:\DevUnity\_SOURCE\_bin\" /Y
    echo f | xcopy "$(TargetDir)$(TargetName).pdb" "D:\DevUnity\_SOURCE\_bin\" /Y
    echo f | "C:\Program Files (x86)\Mono\bin\pdb2mdb.bat" "D:\DevUnity\_SOURCE\_bin\$(TargetFileName)"
    echo f | xcopy "D:\DevUnity\_SOURCE\_bin\$(TargetFileName)" "D:\DevUnity\TileEd2\Assets\plyoung\plyLib\runtime\" /Y
    echo f | xcopy "D:\DevUnity\_SOURCE\_bin\$(TargetFileName).mdb" "D:\DevUnity\TileEd2\Assets\plyoung\plyLib\runtime\" /Y
     
    Snipe3000 and Jinja like this.
  4. Jinja

    Jinja

    Joined:
    Nov 28, 2012
    Posts:
    10
    Thanks for those instructions Leslie, those got me back up and running.