Because the code has been optimized or the local framework is located on the call stack, the expression value cannot be calculated ., Stack expression

Source: Internet
Author: User

Because the code has been optimized or the local framework is located on the call stack, the expression value cannot be calculated ., Stack expression

Preface

 

When I was working on a project in the previous period, I encountered problems such as questions. Now I have been working for a while. I forgot the specific situation. Although I found a solution, however, I still did not figure out the reason for this situation. I found the answer at the help support center of Microsoft, so I would like to record it to avoid forgetting it.

 

Symptom

 

UseResponse. End (), Response. Redirect ()OrServer. Transfer ()Method.ThreadAbortExceptionException. You can useTry-catchTo capture this exception. ProjectResponse. Redirect ()The user successfully logs on to a page, and fails to jump to a page (there are dual-open, login timeout, and other verification in the middle ). Running error:The expression value cannot be calculated because the code has been optimized or the local framework is located on the call stack.

 

Cause

 

Response. End ():End page execution and switch execution to the event pipeline of the applicationApplication_EndRequestEvent,Response. End ()Subsequent code lines will not be executed;
Response. Redirect ()AndServer. Transfer ()Both methods are called internally.Response. End ();

 

Solution

 

 

 

Original reference address: Https://support.microsoft.com/zh-cn/kb/312629

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.