Solved

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

Posted on 2010-11-21
7
3,270 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 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