Is there a way to track a single instace in C#/.NET in Visual Studio while debugging? I find it would be really useful sometimes.
Another way to look at it would be breakpoints on instances rather than code. Therefore, every time my instance is accessed and/or modified the execution stops and I am presented with the line of code which accesses/modifies my instance.
In C++ the equivalence would be monitoring the piece of memory where the instance is located, or simply a pointer to the instance. This approach doesn't work with managed code as the objects in .NET are moved around, therefore I need an equivalence for pointers in C++.
I am aware of WeakReferences in C# but I am not sure if they are of any use while debugging?
Edit1: This question is different from "When debugging, is there a way to tell if an object is a different instance? " as I am not interested in comparing two references, but I want to access a single object.