Setting Conditional Breakpoints

I'm 100% sure I'm being really dumb here, but I can't for the life of me figure out conditional breakpoints...

 

If I make the condition "1 == 1" it works as expected, but I can't seem to get a breakpoint to fire based on something more complex, like two structs or two classes being equal.

Is that behavior not supported or am I going about it incorrectly? Can I do something like...

"myStruct == new Struct(1, 2, 3)"

4 comments
Comment actions Permalink

Hello Timothy Grant

I wonder if "==" operator is overridden? For reference types other than string== by default returns true if its two operands refer to the same object. 

0
Comment actions Permalink

Thank you, for the response, Julia!

I haven't overridden "==" so I don't think that's the problem. I'll keep experimenting. I'm sure I'm doing something silly, I'm just not sure what it is yet! 

0
Comment actions Permalink

We have faced issue with conditionals breackpoint too, so posting it here 

"Object reference not set" happens when debugger hits  breackpoint on property setter 

 

 

0
Comment actions Permalink

My project uses guids, and I finally figured out how to set conditional breakpoints on a guid.  Seems obvious now, but could not find an example.

myEvent.MyId == System.Guid.Parse("A1C7499C-4847-764D-F9C0-39F2212F82A4")

0

Please sign in to leave a comment.