1

I am calling a method which calls an another method asynchronously(using delegates) ..But its not working as expected ..throws this

Unable to evaluate expression because the code is optimized or a 
native frame is on top of the call stack'` exception..

Please help guys

Below is the method which I am calling

public bool ProcessInvoices(string printGroupId, bool isControlNum)
{
    //Create delegate for asynchronous operation
    ProcessInvoicesDelegate _processInvoicesDelegate = new ProcessInvoicesDelegate(ProcessInvoicesFromCABSToExstream);
    IAsyncResult result = _processInvoicesDelegate.BeginInvoke(printGroupId, isControlNum, null, null);
    return true;
}
शेखर
  • 17,236
  • 13
  • 56
  • 110
venkat bolar
  • 11
  • 1
  • 2

1 Answers1

1

This only appears in a "watch"-window, right ? Some variables do not exist physically any more, if the "optimize code"-flag in the build properties is enabled. By default this is disabled for debug-build, and enabled for release build, but it can be modified.

Holger
  • 2,316
  • 1
  • 10
  • 13