Conditional breakpoints in Visual Studio 2008

September 22 2010

Not sure why, but I don't remember ever setting conditional breakpoints in .NET.  I've done it countless times in VB6 in years of yore, but can't for the life of me remember doing it (recently) in .NET

It took me  few minutes of looking for the watch window to stumble conditional breakpoints being in the Breakpoints window (der!).  Anyway, here's a quick reminder.

1. Add your breakpoint

Windowslivewriter Conditionalbreakpointsinvisualstudio2008 A557 Image Thumb 2

2. Open the Breakpoints window (Ctrl + Alt + B)

Windowslivewriter Conditionalbreakpointsinvisualstudio2008 A557 Image Thumb 3

3. Find your breakpoint, right click on it and click on "Condition"

4. Once the Breakpoint Condition popup opens, set the Condition checkbox and enter your condition

Windowslivewriter Conditionalbreakpointsinvisualstudio2008 A557 Image Thumb

5.  Your breakpoint will indicate if it is conditional.

Windowslivewriter Conditionalbreakpointsinvisualstudio2008 A557 Image Thumb 4

Windowslivewriter Conditionalbreakpointsinvisualstudio2008 A557 Image Thumb 5

Now execution of my debugging software will stop in the GetElementValue method when elementName = 'price', the case I was having trouble with.

Post a comment

comments powered by Disqus