In a .Net 4.0 project, incorrect behavior is produced with debugger attached. Only observed on VisualStudio 2012 (2010 works as expected.)
In a class containing a DataTable, and several integer member variables with property accessors, one of the integer properties changes when DataTable.NewRow() is called. After the call, one of the integer properties has a new value (which happens to be a value set on a separate instance of this class.) A breakpoint of the property setter is not hit, nor is the base property ever set directly anywhere in code. Same behavior is exhibited when implemented as an auto-property as well.
This behavior is ONLY shown when the VisualStudio 2012 debugger is attached. The integer property remains correct and unchanged until DataTable.NewRow() is called while debugger is attached, and remains incorrect after the debugger is again detached.
The behavior seems *impossible* and baffled a few developers for the greater part of a day. It is almost as if the class instance is mixed up with another. We attempted to verify that this is not the case by assigning a private readonly Guid in the class constructor to differentiate each instance, but the Guid remained unchanged correctly. To make matters worse, only one developer has been able to recreate this issue on their machine, all with exactly the same source.
The Class is IDisposable, Disposing the DataTable in the class destructor. It is part of the model/view-model used by a new child window instance in our app.