Is there a way to place a watch on variable and only have Visual Studio break when that value changes?
It would make it so much easier to find tricky state issues.
Can this be done?
Breakpoint conditions still need a breakpoint set, and I'd rather set a watch and let Visual Studio set the breakpoints at state changes.
Really old post but in case someone is unaware...
In Visual Studio 2015, you can place a breakpoint on the
set
accessor of an Auto-Implemented Property and the debugger will break when the property is updatedUpdate
Alternatively; @AbdulRaufMujahid has pointed out in the comments that if the auto implemented property is on a single line, you can position your cursor at the
get;
orset;
and hitF9
and a breakpoint will be placed accordingly. Nice!