Conditional C# breakpoint?
问题 I'm debugging a foreach loop which will iterate well over 1000 times - so I only want a breakpoint within the loop to break for a particular item. So... foreach(Employee employee in employees) { //DO SOMETHING //BREAK HERE WHEN employee.Id == '2342' //DO SOMETHING ELSE } Do I have to write an If statement and some dummy code within it and break it that way? That the only way? 回答1: Just adding to the previous answers. Use Conditional Breakpoints. You can specify the condition like below 回答2: