Is it possible to step through the code of a dll built in release mode that is optimized and has a pdb file that was generated with the pdb-only
option? (Here it says that pdb-only
vs full
makes no difference though.)
I've read multiple times that dlls built in release mode can be debugged if there are pdbs available (here, here, here, here,or here) .
With Visual Studio I only managed to debug (step into the code) a C# console project in release mode when I unchecked Optimize code
. Do those answers that say it's possible simply assume that optimization is off or is there some other method?
The first linked answer says that it makes post-mortem debugging easier. So I included a throw
statement and then ran the release mode exe directly without Visual Studio. I got the "has stopped working" dialog and when I chose to debug with Visual Studio all I got was
Your app has entered a break state, but there is no code to show because all threads were executing external code.
I didn't see any code although the thrown exception comes directly from my code that has an appropriate pdb-file and not from some other referenced dll.
Edit Here it says that I should get the stack traces with pdb-only
but the Call Stack window only shows [External Code]
.
Maybe Visual Studio is just the wrong tool to get an actual debugging experience?