- Home /
No answer for a long time, and I moved to Visual Studio
Running pdb2mdb.exe as a MonoDevelop
Hello,
I feel quite dumb, but I can't find a way to run pdb2mbd.exe as an "After Build" Custom Command from MonoDevelop.
I want MonoDevelop to create an mdb file for my dll (that already outputs a pdb), as soon as it ends compilation, but I don't know what to write in the "Command" and "Working Directory" fields of the Custom Command panel for my project.
Any help would be immensely appreciated.
EDIT
Moved to Visual Studio where I solved this issue, but in the meantime I discovered that pdb2mdb fails if the dll contains any coroutine. Sigh.
I'm adding this comment just so that people having the problem I was experiencing and the one you mention in "pdb2mdb fails if the dll contains any coroutines".
It's not the coroutines, it's the fact that to use a coroutine, you need to use an IEnumerator and that's what breaks the pdb2mdb.exe file.
The only solution I have for you is to remove all references to IEnumerable or IEnumerator. I'll update the comment if I find a fix that allows you to keep the enumerable stuff in there.
I'm having the opposite problem - I can get pdb2mdb to generate an .mbd when I call it from the post build event, but all I get is a 'usage' error when I call it from anyplace else, including the command line.
It turned out my problem was I needed to be calling pdb2mdb from the directory that holds my .dll and .pdb files, so I had to specify the working directory as such.
Answer by ThePunisher · May 03, 2012 at 02:57 PM
You can check this link out. I think it will help you get started.
Thanks. I already moved to Visual Studio a while ago, and kind of use the same procedure shown in the video (for some reason I couldn't get the same After Build command via $$anonymous$$onoDevelop). Though the issue with pdb2mdb remains, even if I'm not using the one shipped with Unity.
Answer by yoyo · Nov 29, 2012 at 06:39 PM
Here's how I integrated pdb2mdb into my Visual Studio build process. I made these changes by hand-editing the .csproj file.
First, I create a property (in the first PropertyGroup) for the location of the Unity installation:
<UnityInstallFolder>$([System.IO.Path]::GetDirectoryName($(registry:HKEY_CURRENT_USER\Software\Unity Technologies\Unity Editor 3.x\Location)))</UnityInstallFolder>
Then I added a post-build step to call pdb2mdb on my output DLL:
<PostBuildEvent>$(UnityInstallFolder)\Data\Mono\lib\mono\2.0\pdb2mdb.exe $(TargetPath)</PostBuildEvent>
Unfortunately I don't have a solution to the IEnumerator problem. This post mentions implementing a new version of pdb2mdb based on the Mono.Cecil library.
Thanks Yggy. I moved to Visual Studio a while ago and had no problem there (though I never got how to run the same post-build step in $$anonymous$$onoDevelop, but who cares now). Though the pdb2mdb issue is heavily troubling me. Will read that post you mentioned, thanks a lot for pointing at it.
Turns out the "bleeding edge" version of pdb2mdb works with IEnumerator, as described here http://forum.unity3d.com/threads/161685-How-to-build-and-debug-external-DLLs