pdb2mdb usage error from command line

When I call pdb2mdb from a VS Post Build Event like below it works.

pathWithSpacesToUnityPdb2mdb\pdb2mdb.exe" pathWithoutSpacesToAssembly\Assembly.dll

When I call it from a .bat file or even better, from the command line like above, all I get is a usage error

usage pdb2mdb assembly

This even occurs if I’m in the same directory as pdb2mdb.exe and call

pdb2mdb pathWithoutSpacesToAssembly\Assembly.dll

Any ideas about what I’m doing wrong?

Your syntax is correct. It will only work if your current working directory is the one with the .DLL file in it for some reason.

cd\pathtoassemblydirectory
pathtounitypdb2mdb/pdb2mdb.exe Assembly.dll

Also there must be a PDB file in the same folder with your assembly. And if your path has spaces, enclose it in double quotes.

I’m facing this problem today, yeah i know that is an old post, but hope i can help someone.

The solution proposed don’t works for me, i always get the following exception:

System.BadImageFormatException: Invalid PE file.

I tried as in Unity documentation (Unity - Manual: Managed plug-ins): no way.

I solved by adding the dll source directly to the solution on Visual Studio, then setting the ouput folder to Assets/Plugins. Is seems that it performs the conversion automatically, so the debug working fine.
See here for more details.