Solved

A first chance exception of type 'System.Threading.ThreadAbortException'

Posted on 2010-11-21
7
3,218 Views
Last Modified: 2013-12-17
Am building a .net web application on my local machine and when I insert a breakpoint so I can test something I see all the messages (below) in the immediate window.
Everything is working fine with the app so I'm not sure what they can mean. There are no other messages in other windows to give me any other clues.
What is it trying to tell me?

asp.net 4.0
c#
visual studio 2010
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code
A first chance exception of type 'System.NullReferenceException' occurred in App_Code.aidrup4p.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'string.Split'
Step into: Stepping over non-user code 'string.Concat'
Step into: Stepping over non-user code 'string.Concat'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
A first chance exception of type 'System.NullReferenceException' occurred in App_Code.aidrup4p.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'string.Split'
Step into: Stepping over non-user code 'string.Concat'
Step into: Stepping over non-user code 'string.Concat'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
A first chance exception of type 'System.NullReferenceException' occurred in App_Code.oexwrzuj.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'string.Split'
Step into: Stepping over non-user code 'string.Concat'
Step into: Stepping over non-user code 'System.Xml.XmlNode.ChildNodes.get'
Step into: Stepping over non-user code 'string.Concat'
Step into: Stepping over non-user code 'System.Text.StringBuilder.Append'
Step into: Stepping over non-user code 'System.Text.StringBuilder.Append'
Step into: Stepping over non-user code 'System.Text.StringBuilder.Append'
Step into: Stepping over non-user code 'System.Text.StringBuilder.Append'
Step into: Stepping over non-user code 'System.Text.StringBuilder.Append'
Step into: Stepping over non-user code 'System.Text.StringBuilder.Append'
Step into: Stepping over non-user code 'System.Text.StringBuilder.Append'
Step into: Stepping over non-user code 'string.Split'
Step into: Stepping over non-user code 'System.Web.UI.Control.OnLoad'
Step into: Stepping over non-user code 'System.Web.UI.Control.LoadRecursive'
Step into: Stepping over non-user code 'System.Web.UI.Page.ProcessRequestMain'
Step into: Stepping over non-user code 'System.Web.UI.Page.ProcessRequest'
Step into: Stepping over non-user code 'System.Web.UI.Page.ProcessRequest'
Step into: Stepping over non-user code 'System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute'
Step into: Stepping over non-user code 'System.Web.HttpApplication.ExecuteStep'
Step into: Stepping over non-user code 'System.Web.HttpApplication.ApplicationStepManager.ResumeSteps'
Step into: Stepping over non-user code 'System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest'
Step into: Stepping over non-user code 'System.Web.HttpRuntime.ProcessRequestInternal'
Step into: Stepping over non-user code 'Microsoft.VisualStudio.WebHost.Request.Process'
Step into: Stepping over non-user code 'Microsoft.VisualStudio.WebHost.Host.ProcessRequest'
Step into: Stepping over non-user code 'System.Threading.ThreadPoolWorkQueue.Dispatch'
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code
A first chance exception of type 'System.NullReferenceException' occurred in App_Code.nvmhhtli.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code

Open in new window

0
Comment
Question by:QPR
7 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 34184593
First chance exceptions are handled by the runtime. They will not cause your application not to function.
0
 
LVL 29

Author Comment

by:QPR
ID: 34184783
so what is it taking exception to?
0
 
LVL 18

Assisted Solution

by:Richard Lee
Richard Lee earned 150 total points
ID: 34187156
To investigate further into these exceptions you should break when exceptions are thrown.

http://msdn.microsoft.com/en-us/library/d14azbfh.aspx

Debug --> Exceptions in Visual Studio

Plus if this feature still work (!?) you should enable .NET Framework Source Stepping

http://msdn.microsoft.com/en-us/library/cc667410.aspx

DaTribe
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 10

Accepted Solution

by:
thefritterfatboy earned 350 total points
ID: 34189595
Response.Redirect will throw this exception. It is quite a special exception because, despite the fact you caught it, it will be re-processed and thrown again outside your Try Catch to ensure the current thread ends.

You could, if you wanted to enter a world of pain call Reponse.Redirect("Your URL", False) to continue execution - this would not throw the Exception but would continue processing the code on your page (not a good side product unless you really want this to happen!)

The other option is to ignore this particular exception in your try-catches.

Just make the first catch in your catch block an exception type of "System.Threading.ThreadAbortException" and do nothing in that code block.
0
 
LVL 29

Author Comment

by:QPR
ID: 34202252
I have a couple of response.redirects that are set up to take a user back to a particular page should there be some missing querystring data... but I'm not testing that part of the app when I'm seeing this. Or will these exceptions be thrown even if that portion of the code is not running (arrived at)?
0
 
LVL 29

Author Comment

by:QPR
ID: 34202287
actual I'm wrong I am using a response.redirect on button click and each time I use it I get another exception so it looks as though you've nailed that one...
"A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code"

Not sure how to recreate this one though
"A first chance exception of type 'System.NullReferenceException' occurred in App_Code.aidrup4p.dll"

I went to debug->exceptions and ticked everything, but other than write to the intermediate window nothing other seems to be happening in debug mode.
Should it not break and highlight the offending line?

Should I care about these exceptions?
0
 
LVL 10

Expert Comment

by:thefritterfatboy
ID: 34203376
>>Should it not break and highlight the offending line?<<

Not at all, this is the purpose of a "First Chance" exception.

Have a read over this blog for more info;

http://blogs.msdn.com/b/davidklinems/archive/2005/07/12/438061.aspx

It's likely an external piece of code is catching the NullReferenceException and handling it gracefully.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now