469,934 Members | 2,055 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

Unhandled exceptions in Vs 2005

Bob
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
<system>
<runtime>
<legacyUnhandledExceptionPolicy enabled="1"/>
</runtime>
</system>
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
initialize.

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.

Bob
Jun 4 '06 #1
2 1998
Hello Bob,

Check out System.Windows.Forms.Application ThreadException event.
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.

Jun 4 '06 #2
Bob
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
main.

Thanks again for any help,
Bob

"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
routine
that then closes the thread on which the execption occurred without
closing
or affecting the other threads.


Jun 5 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Frank | last post: by
5 posts views Thread by Lucvdv | last post: by
reply views Thread by Colmeister | last post: by
3 posts views Thread by Andreas van de Sand | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.