Search code examples
.netvisual-studiodebuggingconditional-breakpoint

Breaking the Nth time a line gets executed


Is there a way to tell the Visual Studio debugger, "break at this line the Nth time it gets executed, not before" (where N is an integer greater than 1)?
(Just for information, I'm using the C# programming language.)


Solution

  • See this MSDN article - How to: Specify a Hit Count.

    In short - in the breakpoints window you right click the breakpoint and select Hit Count.