Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

error on Response.End(): Unable to evaluate expression ...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tbh - 11 Feb 2008 11:58 GMT
in an error path in an aspx script under DotNet 2, IIS6, Win2003 Server I
get the following error (which I don't understand) on Respone.End():

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

i'm attempting to abort execution with an error and have tried for example:
 System.Web.HttpResponse response =
System.Web.HttpContext.Current.Response;
 response.Clear();

 response.Status = "400 Bad Request";

 response.End();

inside try {} catch {}. when I step through with a debugger control
transfers after response.End() to a catch clause with the exception listed
above.

any ideas what could be causing this and what I can do about it? (i'd like
to avoid 5xx errors in favor of 4xx ones when the problem is a request for
something that isn't there -- as opposed to badly broken code.)

cheers,

Tim Hanson
bruce barker - 11 Feb 2008 16:37 GMT
Response.End(), aborts the current thread. if you call inside a try block,
you will catch the thread abort. if you use a try block, you'll need to catch
the abort and rethrow it.

-- bruce (sqlwork.com)

> in an error path in an aspx script under DotNet 2, IIS6, Win2003 Server I
> get the following error (which I don't understand) on Respone.End():
[quoted text clipped - 22 lines]
>
> Tim Hanson
tbh - 11 Feb 2008 16:43 GMT
thanks!

> Response.End(), aborts the current thread. if you call inside a try block,
> you will catch the thread abort. if you use a try block, you'll need to
[quoted text clipped - 34 lines]
>>
>> Tim Hanson

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.