|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
currentDomain.UnhandledExceptionapplication. MyHandler does not run. Running compiled Release brings up the JIT. What am I missing? Module Module1 Sub Main() Dim currentDomain As AppDomain = AppDomain.CurrentDomain AddHandler currentDomain.UnhandledException, AddressOf MyHandler Try Throw New Exception("1") Catch e As Exception Console.WriteLine("Catch clause caught : " + e.Message) End Try Throw New Exception("2") ' Output: ' Catch clause caught : 1 ' MyHandler caught : 2 End Sub Sub MyHandler(ByVal sender As Object, ByVal args As UnhandledExceptionEventArgs) Dim e As Exception = DirectCast(args.ExceptionObject, Exception) Console.WriteLine("MyHandler caught : " + e.Message) End Sub 'MyUnhandledExceptionEventHandler End Module In article <8b702e36.0504130958.a53a***@posting.google.com>, garbage400
@hotmail.com says... > I have copied this directly from the MSDN example into a Console The VS.NET debugger gets the first chance at the exception. When given > application. MyHandler does not run. Running compiled Release brings > up the JIT. What am I missing? the option to "Debug" or "Continue", click "Continue" and your handler will get called. |
|||||||||||||||||||||||