M
Masa Ito
I am trying to follow the great advice that seems to be said over and over
by good people (like Jay Harlow) about putting a global exception handler
in Sub Main.
Our app has Sub Main in a module. I can add the handler and then can add
the sub, but I can't add it as a shared sub inside this module - V.S. tells
me shared subs are not allowed. Is there another way I can do this while
maintaining this module?
Public Module AppStart
Public Sub Main()
AddHandler Application.ThreadException, AddressOf
OnThreadException
...
End Sub
Private Shared Sub OnThreadException(ByVal sender As Object, ByVal e
as System.Threading.ThreadExceptionEventArgs)
' log e.Exception here
End Sub
End Module
Thanks,
Masa
by good people (like Jay Harlow) about putting a global exception handler
in Sub Main.
Our app has Sub Main in a module. I can add the handler and then can add
the sub, but I can't add it as a shared sub inside this module - V.S. tells
me shared subs are not allowed. Is there another way I can do this while
maintaining this module?
Public Module AppStart
Public Sub Main()
AddHandler Application.ThreadException, AddressOf
OnThreadException
...
End Sub
Private Shared Sub OnThreadException(ByVal sender As Object, ByVal e
as System.Threading.ThreadExceptionEventArgs)
' log e.Exception here
End Sub
End Module
Thanks,
Masa