Reputation: 155
I'm having a Unity project that I want to debug when launched directly from a debug release exe. Long story short - Visual shows on the breakpoint icon that symbols have not been loaded but when I check modules it shows as loaded and points to proper .pdb file.
In Unity (2017.4.0f1) when making build "Copy PDB files", "Development Build" and "Script Debugging" options are selected. Unity makes an executable with matching .pdb files.
In Visual (Community 2017) I attach to running process. When I move over some breakpoint, I get a warning message saying that "No symbols have been loaded for this document". However, when I go to Debug -> Windows -> Modules, my exe shows "Symbol Status" as "Symbols loaded.". The .pdb file shown there points to the right file (double checked).
I tried setting new breakpoints but they also don't get caught. Made sure that the code actually gets run in the app and that the breakpoint indeed is not caught.
Upvotes: 2
Views: 1113
Reputation: 155
Found the solution!
Apparently for Unity projects instead of using 'Attach to process' you need to use 'Attach Unity debugger'.
Weirdly enough, then it shows symbols as not loaded in Modules window but there is no error on breakpoints and they do work.
Upvotes: 1