Search code examples
visual-studio-2010debuggingbreakpointsvisual-studio-debugging

VB.net / C# Break on variable or object change


Say I have a visual studio solution with over 30 projects and each project having more code you can shake a stick at. If I know a object or variable in my code is getting changed past a certain line of code, can I tell visual studio to set a break point and halt when this variable or object changes? Can I tell it to break and halt on certain conditions outside of the scope of a single method?

90% of my time fixing bugs at work are because it takes a long time figure out where it is getting changed, and once I know where I can go from there and usually fix it pretty fast.

  • Does visual studio have this functionality for managed code (VB.net / C#)?
  • Does visual studio have anything similar to that at all?
  • Does visual studio even have the ability to do "smart" debugging?

Solution

  • It seems you can not do this. You can only do condition break points. You could program in a event handler and get a trigger on property changes but this is a lot of work just to debug something.