ASP.NET Error: Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.
I was working with the page and one silly mistake has taken my mind
. Could not figure out at first sight but after debug, it would be found out.
I was doing Following:
try
{
SaveShoppingInformation();
RedirectToHome();
}
catch (Exception ex)
{
throw new Exception("User Information: " + SessionHelper.UserInformation + ex.Message,ex);
}
Now the issue is, When you cover the exception on Response.Redirect, it gives the same error. Following is the solution.
try
{
SaveShoppingInformation();
}
catch (Exception ex)
{
throw new Exception("User Information: " + SessionHelper.UserInformation + ex.Message,ex);
}
RedirectToHome();
It resolves my issue