Cannot evaluate expression because a native frame is on top of the call stack. RRS feed

  • Question

  • Hello,

           I am using .NET Framework 4.0 with EF 4.0 for my wpf for broser app. I receive following error when Inserting records into my table. This Code was functioning properly since last 6 months. But all of a sudden following message appears when on pressing submitt button on my data entry form exception has thron with following error message.


    Cannot evaluate expression because a native frame is on top of the call stack.

    Code Block where expresson (on last line of the following code block Line with bold and underline)

     public ObjectResult<GetAcSubHeadPriorityWiseBalanceBeena_Result> GetAcSubHeadPriorityWiseBalanceBeena(global::System.String acCode, Nullable<global::System.DateTime> voucherDate)
                ObjectParameter acCodeParameter;
                if (acCode != null)
                    acCodeParameter = new ObjectParameter("AcCode", acCode);
                    acCodeParameter = new ObjectParameter("AcCode", typeof(global::System.String));
                ObjectParameter voucherDateParameter;
                if (voucherDate.HasValue)
                    voucherDateParameter = new ObjectParameter("VoucherDate", voucherDate);
                    voucherDateParameter = new ObjectParameter("VoucherDate", typeof(global::System.DateTime));
               return base.ExecuteFunction<GetAcSubHeadPriorityWiseBalanceBeena_Result>("GetAcSubHeadPriorityWiseBalanceBeena", acCodeParameter, voucherDateParameter);
           After reding several other posts related to we have also removed try catch from the code from which it was executed. But fpr some times this message was disappear and again the same message is blocking my production coed. Can any one tell me where should I look for the resolution of the error.


    Sunday, March 17, 2013 6:58 AM

All replies

  • Hi Nilkanth,

    Welcome to the MSDN forum.

    I am trying to involve a senior expert into your problem. Please wait for the response. Sorry for any inconvenience.

    Good day.

    Alexander Sun [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 18, 2013 6:24 AM
  • Hello Nilkanth,

    Can you post the entire callstack for the error?  If you are actually debugging a managed application, and you are in a native stackframe, just press F10 or Shift+F11 repeatedly until you are back in managed code. Then you can evaluate expressions.

    -Sandeep Chalke.

    Monday, March 25, 2013 12:36 PM