Oh, I do plan to handle them. It is just that I want to do it in one place,
based on the exception type, instead of debugging all of this guys code.
I dont quite understand what you wrote about attaching an
UnhandledException event. Could you give me a few more details plz?
your help greatly appreciated.
thanks
LK
"Sean Hederman" <us***@blogentry.com> wrote in message
news:cu**********@ctb-nnrp2.saix.net...
Just to add to this, it probably isn't the greatest idea to swallow these
exceptions. They've been thrown for a reason. Pretending they don't exist
will quite possibly leave the application in a worse state than just
exiting.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:%2***************@TK2MSFTNGP15.phx.gbl... Laxmikant,
You will probably want to get the current AppDomain (through the
static CurrentDomain property on the AppDomain class) and then attach to the
UnhandledException event.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Laxmikant Rashinkar" <LK-at-televital-dot-com> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl... Hi,
I am working with a program that someone else wrote.
This program is full of bugs and unhandled exceptions are thrown all
over the code.
Instead of trying to catch the exception at each point it is thrown, I
am wondering
if it is possible to catch all exceptions at a top level. I tried the
following but it does not work.
Does anyone have any ideas about how this can be achieved?
thanks a lot
LK
-----
class Form1 : System.Windows.Forms.Form
{
[STAThread]
static void Main()
{
try
{
Application.Run(new Form1());
}
catch(Exception ex)
{
// unfortunately this does not catch any exceptions for me
}
}
}