Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-11-21
7
Medium Priority
?
3,460 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 600 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 10

Accepted Solution

by:
thefritterfatboy earned 1400 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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 anti-spam), the admin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

963 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