I am using SPLongOperation while creating a sub-site using template. The issue I am facing is when sub-site is created and I redirect using SPLongOperation.End() I am getting below error:

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

Here is my code sample:

using (SPLongOperation lo = new SPLongOperation(Page)) 
          // Create Sub-site using template
          lo.End(sub-site URL);// here it throws error
catch(exception ex)
    throw ex;

When I search this error, I found this link which suggest we need to pass false parameter while redirect. But I am not able to pass this in SPLongOperation.

If anyone can suggest how can I solve this? Thanks in Advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.