Conditional breakpoints are another hidden gem when it comes to debugging. This allows you to specify one or several conditions. When one of these conditions is met, the code will stop at the breakpoint. Using conditional breakpoints is really easy.
Setting conditional breakpoints
Getting ready
There is nothing you specifically need to prepare to use this recipe.
How to do it...
- Add the following code to your Program.cs file. We are simply creating a list of integers and looping through that list:
List<int> myList = new List<int>() { 1, 4, 6, 9, 11 };
foreach(int num in myList)
...