472,378 Members | 1,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 software developers and data experts.

Unhandled exceptions in Vs 2005

I MUST be able to trap unhandled exceptions, bring the thread to a routine
that then closes the thread on which the execption occurred without closing
or affecting the other threads. Think of an Interactive voice response
telephone application. An unforeseen error occurs on one phone call. You
terminate that phone call politely but you don't all of a sudden hang up
the phone without warning on the other 400 callers that are on line at that
time. I had devised a way way to do this in Vs2003 but when I upgraded my
project to be developped in Vs2005, all of a sudden my unhandled exception
handler no longer works. I did a LOT of looking through posts and newsgroups
and found that our beloved <GGGG> Microsoft has brought fundamenatle changes
to the handling of unhandled exceptions and that now, no matter what, they
will always close the application BUT I also found a comment buried in the
basement of the documentation where it says that if you change the
app.config settings by putting
<legacyUnhandledExceptionPolicy enabled="1"/>
in the app config file then the .net framework V2 will handle unhandled
exceptions for that app as they were handled in framework 1.1.

When I incuded that code inside the configuration section of my app.config
on restart of my application I got an error System configuration failed to

If I put the bit of code outside the <configuration> at the root of the XML
it won't be accepted. XML documentation cannot contain multiple root
elements is what I get in the IDE.

I can see that we have the new applicationEventsVb in VS2005 in which
unhandled exceptions can be handled but it always brings up a dialog box
that stops the main thread until someone clicks on it. In my case this will
stop the execution of other 400 phone calls. I need to be able to handle
unhandled exceptions and clean up that thread cleanly without interrupting
the other calls, no user interaction needed or wanted. The app cleans itself
up, takes a screen shot, takes the stack trace, takes the error info and
sends the info to tech support, but the other calls continue unless they too
hit an unhandled exception. Everything has a try catch block that does a
cleanup but we need the additional reliability described to prevent other
calls from crashing when the unexpected does occur. This is an IVR
application that has many callers online at the same time so it can never be
allowed to hang up unexpectedly.

I have the option of going back to Vs2003 but that puts my customers at
jeopardy in the future. Additional OS or framework changes and the app would
need conversion. It is something I do not want to do. I need to be able to
handle this in frameworkV2. Unlike Microsoft, my business model is NOT
planned obsolescence but above all else reliabilty.

Any help would be greatly appreciated.

My best regards to Bill anyways.

Jun 4 '06 #1
2 2080
Hello Bob,

Check out System.Windows.Forms.Application ThreadException event.
I MUST be able to trap unhandled exceptions, bring the thread to a
that then closes the thread on which the execption occurred without
or affecting the other threads.

Jun 4 '06 #2
I looked at it but the sample code is for an app that starts with a sub
main. I use the application framework. I get an eassy way get a splash
screen and to use the applicationEvents.vb file. Does anyone by change have
a bit of sample code that demanonstrates how to use these events when the
Winform app uses the application framework instead of starting on a sub

Thanks again for any help,

"GhostInAK" <gh*******@gmail.com> wrote in message
news:c7*************************@news.microsoft.co m...
Hello Bob,

Check out System.Windows.Forms.Application ThreadException event.
I MUST be able to trap unhandled exceptions, bring the thread to a
that then closes the thread on which the execption occurred without
or affecting the other threads.

Jun 5 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Frank | last post by:
Hi, I made a handler for unhandled errors. But before that is executed, VB.NET gives me the standard error window. In VB6 there was a setting (errortrapping) about handling errors in the design...
by: Lucvdv | last post by:
Can someone explain why this code pops up a messagebox saying the ThreadAbortException wasn't handled? The first exception is reported only in the debug pane, as expected. The second (caused by...
by: Samuel R. Neff | last post by:
When you have an unhandled exception in vb.net how do you view the exception information in the debugger? In C# the debugger creates a local variable that points to the exception and you can...
by: Colmeister | last post by:
I recently read Jason Clark's excellent article on Unhandled Exceptions (http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx) and have attempted to incorporate the features he talks...
by: IraG | last post by:
When I select Exceptions... from the Debug menu in VS .Net 2005, I am only seeing a "Break when exception is thrown" column of checkboxes. There is no checkbox column for "Break when exception is...
by: Bob | last post by:
In Vs 2005 you have new applicationsEvents.vb I was testing it in a simple app and found that it was easier to implement unhandled exception management tah it was in Vs2003 (vb.net) You can, if you...
by: Andreas van de Sand | last post by:
Hi everyone, I've got an application which uses a custom exception handler and to avoid unhandled exceptions I've got a try{}catch (Exception){} block around the main Application.Run(...). ...
by: joseph_gallagher | last post by:
Hi, I've recently ported a .Net 1.1 application to .Net 2.0 and the one new feature that is getting on my nerves is that when there is an unhandled exception the application completely crashes,...
by: bg_ie | last post by:
Hi, I have the following Program.cs - namespace TestFrameworkApplication { static class Program { /// <summary> /// The main entry point for the application.
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.