tags:

views:

328

answers:

3

Is there any way to find all references to an object while debugging?

+2  A: 

Not without using the profiling/debugger API, as far as I'm aware. (Even with the API, I don't know how to do it.)

Jon Skeet
A: 

Not with the default tools that Visual Studio offers you. There are 3rd party "Memory Profilers" out there that will allow you to do this. I have used one myself to hunt down a "memory leak" in a .NET program.

Vilx-
+2  A: 

If you're willing to dig into WinDbg it is fairly easy to find references to a specific object. However, WinDbg is not the easiest tool to use.

This blog has lots of info on using WinDbg.

Brian Rasmussen
I'm go to dive into this tool. Thanks.
Sorskoot
You're welcome - I use WinDbg on a regular basis for managed code. Check out sosex.dll as well (more commands for managed debugging with WinDbg).
Brian Rasmussen