P
Penelope Dramas
Hello,
I am using following code to handle unhandled exceptions in Windows Forms.
Shared Sub Main()
Dim GlobalExceptionHandler As New GlobalExceptionHandler
AddHandler Application.ThreadException, AddressOf
GlobalExceptionHandler.OnThreadException
Application.Run(New MainForm)
End Sub
Exception Class:
Public Class GlobalExceptionHandler
'Handle the exception event
Public Sub OnThreadException(ByVal sender As Object, ByVal t As
Threading.ThreadExceptionEventArgs)
'log exception
Helper.LogException(t.Exception, "Unhandled exception.")
End Class
What code can I use to handle unhandled exception when developing a Windows
Service?
Thanks,
Pen D.
I am using following code to handle unhandled exceptions in Windows Forms.
Shared Sub Main()
Dim GlobalExceptionHandler As New GlobalExceptionHandler
AddHandler Application.ThreadException, AddressOf
GlobalExceptionHandler.OnThreadException
Application.Run(New MainForm)
End Sub
Exception Class:
Public Class GlobalExceptionHandler
'Handle the exception event
Public Sub OnThreadException(ByVal sender As Object, ByVal t As
Threading.ThreadExceptionEventArgs)
'log exception
Helper.LogException(t.Exception, "Unhandled exception.")
End Class
What code can I use to handle unhandled exception when developing a Windows
Service?
Thanks,
Pen D.