How do I find the number of references that exist for a particular object?
I have a bit of code that passes around a ton of objects and I want to determine if there are any references still lingering around that I am unaware of and where it is those references are located. Any idea of how I can do this?
My understanding is that the watch window only allows me to see items available to the currently executing code block, and the "Find All References" only helps if I add references to objects at compile time. Unless there is more to the watch window than I am aware of.
A profiler will allow you to do this. CLR Profiler or ANTS Profiler are two examples.
if you are talking in the code, just right click on the object name, in the drop down menu pick "Find all references", the list of references will appear below in the output window
EDIT: Since there was only a .NET tag, Visual Studio assumed
In a IDE like Elcipse or Visual Studio you can do it with the context menu.