How can I set a breakpoint in referenced code in Visual Studio?

后端 未结 7 1880
闹比i
闹比i 2020-12-24 05:12

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?

相关标签:
7条回答
  • 2020-12-24 05:38

    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.

    0 讨论(0)
提交回复
热议问题