Writing the actual condition can be the tricky part, so I tend to
- Set a regular breakpoint.
- Run the code until the breakpoint is hit for the first time.
- Use the Immediate Window (Debug > Windows > Immediate) to test your expression.
- Right-click the breakpoint, click Condition and paste in your
expression.
Advantages of using the Immediate window:
- It has IntelliSense.
- You can be sure that the variables in the expression are in scope when the expression is evaluated.
- You can be sure your expression returns true or false.
This example breaks when the code is referring to a table with the name "Setting":
table.GetTableName().Contains("Setting")