Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > System.Threading.ThreadAbortException and Response.Redirect

Reply
Thread Tools

System.Threading.ThreadAbortException and Response.Redirect

 
 
Henrik Stidsen
Guest
Posts: n/a
 
      08-31-2006
I have implemented a log-system for exceptions in an ASP.NET
application using the Application_Error event in Global.asax.
ThreadAbortExceptions gets thrown everytime Response.Redirect is being
used with the second parameter set to true which, according to
Microsoft, is by design...

How do I get around this ? I would hate to have the log filled with
this exception on high-traffic sites. Setting the second parameter to
false is not an option.

I have tried with a try-catch block around the Response.Redirect call,
didn´t help, the exception still gets "recorded".

 
Reply With Quote
 
 
 
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      08-31-2006
A couple options...

a - Don't set the 2nd parameter to true

b - Before logging the exception, check it's type and don't log
ThreadAbortExceptions

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/


"Henrik Stidsen" <> wrote in message
news: ups.com...
I have implemented a log-system for exceptions in an ASP.NET
application using the Application_Error event in Global.asax.
ThreadAbortExceptions gets thrown everytime Response.Redirect is being
used with the second parameter set to true which, according to
Microsoft, is by design...

How do I get around this ? I would hate to have the log filled with
this exception on high-traffic sites. Setting the second parameter to
false is not an option.

I have tried with a try-catch block around the Response.Redirect call,
didn´t help, the exception still gets "recorded".


 
Reply With Quote
 
 
 
 
Henrik Stidsen
Guest
Posts: n/a
 
      08-31-2006
Karl Seguin [MVP] skrev:
> A couple options...
> a - Don't set the 2nd parameter to true


It would certainly be the easy way - but sometimes the world is not
that easy

> b - Before logging the exception, check it's type and don't log
> ThreadAbortExceptions


Wouldn't I risk to throw out exceptions that I want to log or is
Response.Redirect the only (built-in) function that throws this
Exception ?

 
Reply With Quote
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      08-31-2006
No, it isn't the only function, so yes, you'd risk throwing away meaningful
information.

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/


"Henrik Stidsen" <> wrote in message
news: oups.com...
> Karl Seguin [MVP] skrev:
>> A couple options...
>> a - Don't set the 2nd parameter to true

>
> It would certainly be the easy way - but sometimes the world is not
> that easy
>
>> b - Before logging the exception, check it's type and don't log
>> ThreadAbortExceptions

>
> Wouldn't I risk to throw out exceptions that I want to log or is
> Response.Redirect the only (built-in) function that throws this
> Exception ?
>



 
Reply With Quote
 
Siva M
Guest
Posts: n/a
 
      08-31-2006
This will give more clarity: http://support.microsoft.com/kb/312629/EN-US/

"Henrik Stidsen" <> wrote in message
news: ups.com...
I have implemented a log-system for exceptions in an ASP.NET
application using the Application_Error event in Global.asax.
ThreadAbortExceptions gets thrown everytime Response.Redirect is being
used with the second parameter set to true which, according to
Microsoft, is by design...

How do I get around this ? I would hate to have the log filled with
this exception on high-traffic sites. Setting the second parameter to
false is not an option.

I have tried with a try-catch block around the Response.Redirect call,
didn´t help, the exception still gets "recorded".

 
Reply With Quote
 
Henrik Stidsen
Guest
Posts: n/a
 
      09-01-2006
Siva M skrev:
> This will give more clarity: http://support.microsoft.com/kb/312629/EN-US/


I have read that - it seems the only way to avoid the exception is
this:
Response.Redirect(NewURL, False)
HttpContext.Current.ApplicationInstance.CompleteRe quest()

That seems like a bad workaround... :/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
An exception of type 'System.Threading.ThreadAbortException' JoeP ASP .Net 1 12-30-2007 11:27 PM
System.Threading.ThreadAbortException: Thread was being aborted. Daniel Knöpfel ASP .Net 2 01-08-2007 10:16 AM
System.Threading.ThreadAbortException kowshikj@gmail.com ASP .Net 1 10-12-2006 09:57 PM
Response.Redirect gens ThreadAbortException that's either not being caught or thrown a second time. Eric ASP .Net 1 08-19-2005 06:00 PM
Help ThreadAbortException for Response.Redirect! VB Programmer ASP .Net 1 11-06-2003 06:58 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57