2

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,412
  • 13
  • 61
  • 117
venkat bolar
  • 21
  • 1
  • 2

1 Answers1

2

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,446
  • 1
  • 14
  • 13