473,327 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Application Exception Popup Messagebox

I have written a c# windows application which is occasionally throwing this
messagebox popup exception in the test environment:

"application has generated an exception that could not be handled"

I have try - catch around the entire application and would expect this to
prevent any type of messagebox from appearing. Any ideas on why this is
occuring and how to remedy? Are there settings in the project configuration
properties that will disable this? I can't seem to recreate the error in our
development environment and I dont have studio installed on test so there is
no way for me to find out more info regarding this error (that I am aware
of). All suggestions are appreciated.

thanks in advance!
Nov 16 '05 #1
1 6579
"Chris Fink" <ch*********@hotmail.com> a écrit dans le message de
news:uW**************@TK2MSFTNGP12.phx.gbl...
I have written a c# windows application which is occasionally throwing this messagebox popup exception in the test environment:

"application has generated an exception that could not be handled"

I have try - catch around the entire application and would expect this to
prevent any type of messagebox from appearing. Any ideas on why this is
occuring and how to remedy? Are there settings in the project configuration properties that will disable this? I can't seem to recreate the error in our development environment and I dont have studio installed on test so there is no way for me to find out more info regarding this error (that I am aware
of). All suggestions are appreciated.

thanks in advance!


Maybe you should have a look at the event :
AppDomain.UnhandledException
It enables you to catch any exception not caught in the main method or
anywhere else.

Here is a sample from the MSDN documentation :

public static void Main() {
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException += new
UnhandledExceptionEventHandler(MyHandler);

try {
throw new Exception("1");
} catch (Exception e) {
Console.WriteLine("Catch clause caught : " + e.Message);
}

throw new Exception("2");

// Output:
// Catch clause caught : 1
// MyHandler caught : 2
}

static void MyHandler(object sender, UnhandledExceptionEventArgs args) {
Exception e = (Exception) args.ExceptionObject;
Console.WriteLine("MyHandler caught : " + e.Message);
}

Nov 16 '05 #2

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

Similar topics

0
by: guy | last post by:
i have a method which throws an exception. the thing i dont understand is that the only change between the two versions is a line of code AFTER the one that throws the exception - see code below...
7
by: Bill | last post by:
For some reason, I have an errormessage popup that "blinks", but pops up BEHIND the applications, which is confusing to users. Is there any way to force it to the top?
1
by: Alpha | last post by:
I have a Window based application that shows up still running in the task manager when I close it. It reaches the "this.close" statement and then it stops at the "}" at the section of the...
2
by: Alex | last post by:
My Problem is that although i have added a handler to Application.ThreadException and it works fine for my application exceptions, it does not fire if an exception is generated inside an event...
8
by: mike2036 | last post by:
I have an application (that has unmanaged code) and when I launch it without 'FullTrust' permissions (LocalIntranet_Zone), it crashes. When I set 'FullTrust' permissions, it launches fine. Is...
1
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...
8
by: Jean Paul Mertens | last post by:
Hello to all, I use a lib class to handle all my exeption errors ocured in my objects. Since my objects are used in windows applications as well as in web applications, I would like to determine...
3
by: CharlieC | last post by:
I am writing a windows C# application, and I want to ensure that all exceptions, handled or otherwise, are logged to the local event log. I can do this for the handled exceptions, but I am not sure...
2
by: Learning.Net | last post by:
hi , I have a application which reads files, directory,and its version and version information is written to text file.Its working fine if files in directory are less but problem arises when no...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.