How to set conditional breakpoints in Visual Studio?

前端 未结 13 2353
忘了有多久
忘了有多久 2020-11-27 03:35

Is there an easy way to set conditional breakpoints in Visual Studio?

If I want to hit a breakpoint only when the value of a variable becomes something, how can I do

13条回答
  •  借酒劲吻你
    2020-11-27 04:12

    1. Set a breakpoint as usual
    2. Right click on the breakpoint and select Condition
    3. You'll see a dialog that says "Breakpoint Condition"
    4. Put a condition in the field e.g. "i==5"

    The breakpoint will only get hit when i is 5.

提交回复
热议问题