« XMLNodeList lacks any public constructor, XmlDocument.Create*() factory methods | Main | XmlTextWriter, Console.Out »

Debugging Properties with Getter Side-Effects, Timers

Spent much too much time (2+ hours) discovering how badly the Visual Studio Debugger behaves if there are objects with properties which have getter side-effects. The locals window evaluates displayed properties roughly 20 times per step.

There don’t appear to be usable attributes that might be assigned to these properties to keep the debugger from evaluating them. So the moral of the morning is: AVOID PROPERTIES WITH STATE ALTERING GETTER SIDE-EFFECTS.

Still unexplained is why the locals window sometimes displays private members and sometimes doesn’t. And why the DebuggerHiddenAttribute and DebuggerStepThroughAttribute have identically described function.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)