Search code examples
c#objectlivecreation

How can I get the list of live objects in c#?


I want to get the list of live objects defined in my application.

By live objects, I mean every objects created.

For example, let's say there are controls object created in some part of an application and I want to access a particular one by name.

Or I would want to access some private object in some public class where I have no "starting" point of access to the public class object.

There must be a way since it's what a debugger does essentially.


Solution

  • Not an easy task. I think the closest is the Profiler API. This is another site that is a good reference for profiling API.