473,708 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>
<legacyUnhandle dExceptionPolic y 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 <configuratio n> 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 applicationEven tsVb 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 2178
Hello Bob,

Check out System.Windows. Forms.Applicati on 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 applicationEven ts.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*******@gmai l.com> wrote in message
news:c7******** *************** **@news.microso ft.com...
Hello Bob,

Check out System.Windows. Forms.Applicati on 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2401
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 environment and classes, which should prevent the before mentioned behaviour. Does VB.NET have a setting like it? Or is there something else? Thanks in advance Frank
5
5740
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 thread.Abort()) is reported twice: once in the debug window, and once through the message box. Is it because the thread was sleeping when the exception occurred?
5
3306
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 view it in one of the windows (autos or locals, don't remember which). That doesn't appear to be the case with vb.net. I also tried using the command window to inspect "Err" but that gave nothing useful (always empty).
0
1985
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 about in a new application I'm writing. However, when I try to use ThreadStart to do some work in a separate thread from my GUI, the methods Jason described don't seem to catch the exception. Take the following source code: Public Class...
1
1576
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 user-unhandled", as described in the help file. Would anybody have an idea on why this might be the case, and/or how could get back the ability to select breaking on user-unhandled exceptions as I had been able to do in dotnet 2003? I have...
1
6313
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 want to, prevent your app from terminating on an unhandled exception, and for me this is important. In an Ivr app it will let me hang up the phone only on the line that triggered the unhandled exception, leaving other callers to complete their...
3
1946
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(...). Works all good on my machine, whenever something unexpected happens the exception get caught, logged and it shows a nicer message. Unfortunately for some reason, this only works on my machine! If i deploy my project to some other computer I get the...
20
11471
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, causing user to loose all the work they have done where they could previously just click continue and in 99% of cases be fine. Is there an option to turn this annoying crash and loose everything option off, I can see it has its merits but in my...
1
914
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.
0
8697
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9158
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9060
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5939
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4454
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4712
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2508
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2096
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.