// API for this class public void Attach(uint processId) { if (_debug == null) Init(); _activeProcess = _debug.DebugActiveProcess(processId, 0); ICorDebugThreadEnum threads = _activeProcess.EnumerateThreads(); uint count = 0; //threads.GetCount(out count); count = threads.GetCount(); Console.WriteLine("thread count: " + count); /* Type type = threads.GetType(); MethodInfo mi = type.GetMethod("GetCount"); count = (uint)mi.Invoke(threads, new Object[] { }); Console.WriteLine("thread count: " + count); */ }
// API for this class public void Attach(uint processId) { if (_debug == null) { Init(); } _activeProcess = _debug.DebugActiveProcess(processId, 0); ICorDebugThreadEnum threads = _activeProcess.EnumerateThreads(); uint count = 0; //threads.GetCount(out count); count = threads.GetCount(); Console.WriteLine("thread count: " + count); /* * Type type = threads.GetType(); * MethodInfo mi = type.GetMethod("GetCount"); * count = (uint)mi.Invoke(threads, new Object[] { }); * Console.WriteLine("thread count: " + count); */ }