In Visual Studio, is there a way to discover all objects with a reference to a specific object?

Viewed 258

I have an object that is created in a complex process. Sorry, I can't show code because even though the creation is simple, due to a messaging system integrated into the application, I am having a very hard time finding where this object has references maintained in memory.

What I would like to do is put a breakpoint in my code at the last place this object should be referenced. Once that breakpoint is hit, I'd like to search and see all references to the object in code outside the given method where the debugger has halted. To be clear, I'm not looking for all references to a variable or property, nor am I looking for all references to a given class. Instead, at some point a new instance of one of my objects is created. I need to see where all it is having an instance reference maintained, so I can properly destruct the object.

Is there a tool that can do this in Visual Studio? This is in a C# project for a .Net Framework project.

0 Answers
Related