Reputation: 3304
I am getting error like
System.Threading.ThreadAbortException: Thread was being aborted.
at System.String.wstrcpy(Char* dmem, Char* smem, Int32 charCount)
at System.String.FillStringChecked(String dest, Int32 destPos, String src)
at System.String.Concat(String str0, String str1)
at reporterror.Page_Load(Object sender, EventArgs e)
Can anyone help to know why this error comes? Why Thread was being aborted error comes?
Upvotes: 0
Views: 1316
Reputation: 1817
Not sure if this is why you are seeing this, but in ASP.NET if you redirect out of a catch block you will get Thread was being aborted
catch (Exception ex)
{
//This will throw "Thread was being aborted"
response.redirect("~\default.aspx");
}
Upvotes: 1
Reputation: 61401
When a call is made to the Abort method to destroy a thread, the common language runtime throws a ThreadAbortException
. ThreadAbortException
is a special exception that can be caught, but it will automatically be raised again at the end of the catch block.
In other words wstrcpy
called Thread.Abort()
EDIT: Or main thread called Abort()
on Thread that Page_Load()
was running on.
Upvotes: 1