all groups > dotnet clr > july 2003 >
You're in the

dotnet clr

group:

Strange: impossible to catch the exception



Re: Strange: impossible to catch the exception Thomas Schrantz
7/25/2003 10:45:28 AM
dotnet clr: Could the exception be coming from another thread or from some static
initialization on the class where Main lives? A try/catch around the entry
point won't catch those cases. Attaching a handler to
AppDomain.UnhandledException should let you catch something that occurs in
another thread. Unfortunately, as far as I know, if it's static
initialization that's happening before the entry point is even called,
you'll have to figure it out based on what Visual Studio will tell you.

--
Thomas Schrantz
Sr. Software Engineer
Acquist Incorporated

Strange: impossible to catch the exception Oleg
7/25/2003 6:29:41 PM
Hello,

I get a very strange thing.
Some form generates an exception during load.
Application has a catch block to deal with it.
Everything is ok if application runs under Visual Studio's
debugger (exception is caught and remains to work).
If I run the application not under Visual Studio
then I get unhandled exception. I even have generic catch
block which guards the application entry point method -
it does not help, I cannot catch that exception AT ALL.

Does anyone know what the problem is?

Thanks,

Oleg

Re: Strange: impossible to catch the exception Kumar Gaurav Khanna [.NET MVP]
7/25/2003 8:26:17 PM
Hi!

Setup a handler for the AppDomain's UnhandledException event. Using
it, any exception, that goes out of the standard try/catch blocks will
be caught.


Regards,
Gaurav Khanna
---------------
Microsoft MVP - .NET
WinToolZone - Spelunking Microsoft Technologies
http://www.wintoolzone.com/
OpSupport - Spelunking Rotor
http://opsupport.sscli.net/

On Fri, 25 Jul 2003 18:29:41 +0300, "Oleg"
[quoted text, click to view]
AddThis Social Bookmark Button