debug inside callback method

Does anybody know how to debug inside a callback method I need to debug inside MyMethod() in the following example. Is it possible at all Thanks in advance.

e.g.

ThreadPool.QueueUserWorkItem(new WaitCallback(MyMethod), pw);

private void MyMethod(object status)

{

IProgressCallback callback = status as IProgressCallback;

for (int i = 0; i < 10; i++)

{

callback.StepTo((i + 1) * 10000 / 10);

......

}

callback.End();

}



Answer this question

debug inside callback method

  • frli01

    Can't you just set a breakpoint in the method



  • Stephaen marois

    I did set a breakpoint. But it seems the program will crash or run forever when there is a breakpoint in the method. Without the breakpoint, the program runs fine. So I figured maybe debugging is impossible inside the method.
  • debug inside callback method