G
Groundskeeper
I can't seem to get a custom UnhandledException handler working for a
Windows Service I'm writing in VB.NET. I've read the MSDN and tried
various different placements of the AddHandler call, to no avail.
Here's the code I'm using, all of which is in the main service class:
Protected Overrides Sub OnStart(ByVal args() As String)
AddHandler AppDomain.CurrentDomain.UnhandledException, _
AddressOf UnhandledExceptionHandler
Throw New Exception
End Sub
Sub UnhandledExceptionHandler(ByVal sender As Object, _
ByVal e As System.UnhandledExceptionEventArgs)
Me.EventLog.WriteEntry("This entry will never be written, " & _
"because the programmer doesn't know what he's doing.")
End Sub
Any help would be appreciated, so if you want to be appreciated by an
idiot, please help.
Windows Service I'm writing in VB.NET. I've read the MSDN and tried
various different placements of the AddHandler call, to no avail.
Here's the code I'm using, all of which is in the main service class:
Protected Overrides Sub OnStart(ByVal args() As String)
AddHandler AppDomain.CurrentDomain.UnhandledException, _
AddressOf UnhandledExceptionHandler
Throw New Exception
End Sub
Sub UnhandledExceptionHandler(ByVal sender As Object, _
ByVal e As System.UnhandledExceptionEventArgs)
Me.EventLog.WriteEntry("This entry will never be written, " & _
"because the programmer doesn't know what he's doing.")
End Sub
Any help would be appreciated, so if you want to be appreciated by an
idiot, please help.