Solved

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

Posted on 2010-11-21
7
3,175 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 74

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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 to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

23 Experts available now in Live!

Get 1:1 Help Now