How do I get the reference count for a managed object?
1 answer
They use unmanaged APIs that provide access to the profiler.
ICorProfilerCallback and ICorProfilerCallback2 are the main ones.These are the interfaces that use .NET profilers. There are a few more links like this .
You can use class loading (ClassLoadFinished ()) and unloading (ClassUnloadFinished ()) methods to keep track of this information.
+4
source to share