ASP.NET 에서 '이벤트 뷰어'의 목록 중에 [스레드가 취소 되었습니다. Thread was being aborted] 로그를 만나는 때가 있습니다.
이 예외는 Response.Redirect , Server.Transfer 를 사용 했을때 발생하는 알려진 문제 입니다.
다음과 같은 시도를 했을 때 발생하는 예외인데요
FormsAuthentication.SignOut();
Response.Redirect("Login.aspx");
아래와 같은 로그가 남게 됩니다.
Source : mscorlib
Method : AbortInternal
Date :
Time :
Computer :
Error : Thread was being aborted.
Stack Trace : at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpResponse.Redirect(String url, Boolean endResponse)
at System.Web.HttpResponse.Redirect(String url)
해결방법으로는 Server.Execute 를 사용, 또는
Response.Redirect ("nextpage.aspx", false);
를 사용하는 것 입니다.
URL 다음에 boolean 파라미터는 현재 페이지를 종료할 것이냐를 의미하는 것으로, 종료하지 않음 파라미터를 전달하여 스레드가 종료되지 않도록 알립니다.
//
// Summary:
// Redirects a client to a new URL. Specifies the new URL and whether execution
// of the current page should terminate.
//
// Parameters:
// url:
// The location of the target.
//
// endResponse:
// Indicates whether execution of the current page should terminate.
//
// Exceptions:
// System.ArgumentNullException:
// url is null.
//
// System.ArgumentException:
// url contains a newline character.
//
// System.Web.HttpException:
// A redirection is attempted after the HTTP headers have been sent.
//
// System.ApplicationException:
// The page request is the result of a callback.
public void Redirect(string url, bool endResponse);
다음의 링크는 MS , PRB 주소 입니다.
PRB: ThreadAbortException Occurs If You Use Response.End, Response.Redirect, or Server.Transfer

이 예외는 Response.Redirect , Server.Transfer 를 사용 했을때 발생하는 알려진 문제 입니다.
다음과 같은 시도를 했을 때 발생하는 예외인데요
FormsAuthentication.SignOut();
Response.Redirect("Login.aspx");
아래와 같은 로그가 남게 됩니다.
Source : mscorlib
Method : AbortInternal
Date :
Time :
Computer :
Error : Thread was being aborted.
Stack Trace : at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpResponse.Redirect(String url, Boolean endResponse)
at System.Web.HttpResponse.Redirect(String url)
해결방법으로는 Server.Execute 를 사용, 또는
Response.Redirect ("nextpage.aspx", false);
를 사용하는 것 입니다.
URL 다음에 boolean 파라미터는 현재 페이지를 종료할 것이냐를 의미하는 것으로, 종료하지 않음 파라미터를 전달하여 스레드가 종료되지 않도록 알립니다.
//
// Summary:
// Redirects a client to a new URL. Specifies the new URL and whether execution
// of the current page should terminate.
//
// Parameters:
// url:
// The location of the target.
//
// endResponse:
// Indicates whether execution of the current page should terminate.
//
// Exceptions:
// System.ArgumentNullException:
// url is null.
//
// System.ArgumentException:
// url contains a newline character.
//
// System.Web.HttpException:
// A redirection is attempted after the HTTP headers have been sent.
//
// System.ApplicationException:
// The page request is the result of a callback.
public void Redirect(string url, bool endResponse);
다음의 링크는 MS , PRB 주소 입니다.
PRB: ThreadAbortException Occurs If You Use Response.End, Response.Redirect, or Server.Transfer
스레드는 실 이야!.
댓글을 달아 주세요