Using tuples in conditional breakpoints in Visual Studio 2010
-
20-09-2019 - |
Question
Will this be possible? In F# or C#? Both?
For example, I would like to set a conditional breakpoint in a F# program like that:
[x] Condition:
myTuple == (3,3)
(o) Is true
(_) Has changed
Thanks.
Solution
This condition
System.Tuple.Create(3,3).Equals(myTuple)
seems to work for me.
(Note that F# uses the C# expression evaluator in the debugger, which means breakpoint conditions, immediate window, etc, must use C# syntax, not F# syntax, when debugging F# code. In this instance, however, the same code above is correct in both F# and C#.)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow