What you’re looking for is a conditional break point. Here’s how to set it up assuming the variables name is i.
- Set a normal breakpoint on the line after the value is set
- Right click on the red dot portion of the breakpoint and select “Condition”
- Enter the condition which you want to check for. Example:
i == 10000 - Hit OK
Now run your scenario again and the breakpoint will be hit only when the value of i equals 10000.
A word of warning. You can put pretty much any legal C# expression into a conditional break point but it will be evaluated every single time the break point is hit. That can lead to very slow debugging if use a complex conditional