title: How to fix 'Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack' error in C#
body: <p>I am calling a method which calls an another method asynchronously(using delegates) ..But its not working as expected ..throws this </p>
  
  <pre><code>Unable to evaluate expression because the code is optimized or a 
  native frame is on top of the call stack'` exception..
  </code></pre>
  
  <p>Please help guys</p>
  
  <p>Below is the method which I am calling</p>
  
  <pre><code>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;
  }
  </code></pre>