I'm trying to debug an issue and it would really help if I could have a breakpoint in the getter of a property, but I don't need to break every time it is called from a CanExecute call for some button in my UI. My thought was that I could simply condition the breakpoint on the call stack not containing that string, but that seems to not work. The best way I can think of to explain this is with an image of the settings and the output from the breakpoint being hit.
As you can see in the image, the Conditional settings for the breakpoint is outputted directly when it is hit, and in the output you can see it being hit a few times .get(): true
- correctly. However, when it took this screenshot it was being hit with the condition being false, as seen in the output. The program halted as the breakpoint was hit, incorrectly.
Am I doing something wrong - is this possible at all? Seems to me like a bug in VS2015, the output can evaluate the bool correctly, why can't the breakpoint condition do that?
Edit, to annotate the image in case it gets lost sometime.
I have a breakpoint in the get method of a property that simply returns the underlying field. The Breakpoint settings show that there is a Condition on the breakpoint that defines it such that it should only be hit when the expression !Environment.StackTrace.Contains("CanExecute")
returns true, i.e. only break when the Stack Trace does not contain the "CanExecute" string.
The Action part of the breakpoint settings simply outputs the function name and the conditional expression using $FUNCTION: {!Environment.StackTrace.Contains("CanExecute")}
. The action is set to not continue the execution.