My main solution is using code from a utility class library, that I wrote myself, but is a part from another solution. How can I set a breakpoint in the referenced DLL file?
To set a breakpoint in source code, click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.
If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.
Press F3 and then press F9 to add a breakpoint.
Click Debug, New Breakpoint, Break at Function, then enter the full name of the function.
In Visual Studio open the source file of your referenced DLL that contains the desired method manually using menu
File > Open > File...
Then set the breakpoint by clicking on the left border in the code editor. This enables you to break at any code line and not just at function calls. Visual Studio shows the breakpoint in a kind of disabled state, because it thinks that the code is unreachable. Just ignore it; the breakpoint will become active once the code runs and the DLL has been loaded.
Note: you must reference a Debug version of your assembly for this to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With