Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception on Response.End();

Tags:

c#

asp.net

I got exception on Response.End(); and the error was:

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

Any idea to handle this? I am using VS2008, thanks.

like image 664
Bishal Avatar asked Dec 17 '25 15:12

Bishal


1 Answers

HttpResponse.End is documented to throw a ThreadAbortException. That's the point of it. As noted, it's not a great API to use in general - but the fact that it's throwing an exception isn't a problem.

The error you're seeing is actually just a failure to get at relevant information when debugging - that's not the exception that's been thrown.

like image 70
Jon Skeet Avatar answered Dec 19 '25 05:12

Jon Skeet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!