I'm trying to debug my managed DLL within Unity. It used to work fine on Unity 2018.x
Now I have Unity 2019.3 and I can't debug anymore (my DLLs are working fine I just can't debug them).
My DLL and its pdb file are in the Assets folder. That used to be enough to be able to debug them.
Reading this documentation : https://docs.unity3d.com/Manual/UsingDLL.html, I'm trying to create the mdb file.
First issue, the documentation says I have to pass the .pdb file as a parameter while most links on google say to pass the .dll
This link also states that I should change the working directory of my .bat file to be able to use pdb2mdb.exe : https://answers.unity.com/questions/294195/pdb2mdb-usage-error-from-command-line.html
Here is my code:
set PathToLib="Libraries\"
if exist Libraries\LibBDD.dll (
echo Before switching directory for my lib %CD%
cd %PathToLib%
echo new directory %CD%
@pause
"C:\Program Files\Unity\Editor\Data\Mono\lib\mono\2.0\pdb2mdb.exe" LibBDD.dll
@pause
cd ..\..\..\..\..\
echo LibBDD done, new directory %CD%
)
First of all I'm not sure if my CD command is working since the path remains the same. But I don't get any exception.
With this code I get:
Fatal error: Microsoft.Cci.Pdb.PdbDebugException: Unknown custom metadata item kind: 6 à Microsoft.Cci.Pdb.PdbFunction.ReadCustomMetadata(BitAccess bits) à Microsoft.Cci.Pdb.PdbFunction..ctor(String module, ManProcSym proc, BitAccess bits) à Microsoft.Cci.Pdb.PdbFunction.LoadManagedFunctions(String module, BitAccess bits, UInt32 limit, Boolean readStrings) à Microsoft.Cci.Pdb.PdbFile.LoadFuncsFromDbiModule(BitAccess bits, DbiModuleInfo info, IntHashTable names, ArrayList funcList, Boolean readStrings, MsfDirectory dir, Dictionary`2 nameIndex, PdbReader reader) à Microsoft.Cci.Pdb.PdbFile.LoadFunctions(Stream read, BitAccess bits, Boolean readAllStrings) à Pdb2Mdb.Driver.Convert(AssemblyDefinition assembly, Stream pdb, MonoSymbolWriter mdb)
Without the CD I get:
Mono pdb to mdb debug symbol store converter Usage: pdb2mdb assembly
I'm using Visual Studio 2019 Community.
I'm not sure what I am doing wrong and why I can't debug anymore in Unity. I've tried to add the csproj to the solution in VS but it doesn't do the trick anymore, the symbols are not loaded.