B
Bob Anderson via .NET 247
When I run the VB.NET program below, the entry below appears inthe "Application" log.
The "ServOneLog" log is created, but it is empty. I am trying towrite to the "ServOneLog".
Why doesn't this work??
Application log entry:
The description for Event ID ( 0 ) in Source ( ServOne ) cannotbe found. The local computer may not have the necessary registryinformation or message DLL files to display messages from aremote computer. You may be able to use the /AUXSOURCE= flag toretrieve this description; see Help and Support for details. Thefollowing information is part of the event: LogWorker succeededin writing to ServOneLog..
Program:
Module Module1
Dim el As EventLog
Public Const LOG_NAME As String = "ServOneLog"
Public Const LOG_SOURCE As String = "ServOne"
Sub Main()
Dim appLog As New EventLog("Application")
appLog.Clear()
If (System.Diagnostics.EventLog.SourceExists(LOG_SOURCE))Then
EventLog.DeleteEventSource(LOG_SOURCE)
End If
If System.Diagnostics.EventLog.Exists(LOG_NAME) Then
System.Diagnostics.EventLog.Delete(LOG_NAME)
End If
If (NotSystem.Diagnostics.EventLog.SourceExists(LOG_SOURCE)) Then
EventLog.CreateEventSource(LOG_SOURCE, LOG_NAME)
End If
el = New EventLog(LOG_NAME)
el.Log = LOG_NAME
el.Source = LOG_SOURCE
el.WriteEntry(LOG_SOURCE, "LogWorker succeeded in writingto ServOneLog.")
End Sub
End Module
The "ServOneLog" log is created, but it is empty. I am trying towrite to the "ServOneLog".
Why doesn't this work??
Application log entry:
The description for Event ID ( 0 ) in Source ( ServOne ) cannotbe found. The local computer may not have the necessary registryinformation or message DLL files to display messages from aremote computer. You may be able to use the /AUXSOURCE= flag toretrieve this description; see Help and Support for details. Thefollowing information is part of the event: LogWorker succeededin writing to ServOneLog..
Program:
Module Module1
Dim el As EventLog
Public Const LOG_NAME As String = "ServOneLog"
Public Const LOG_SOURCE As String = "ServOne"
Sub Main()
Dim appLog As New EventLog("Application")
appLog.Clear()
If (System.Diagnostics.EventLog.SourceExists(LOG_SOURCE))Then
EventLog.DeleteEventSource(LOG_SOURCE)
End If
If System.Diagnostics.EventLog.Exists(LOG_NAME) Then
System.Diagnostics.EventLog.Delete(LOG_NAME)
End If
If (NotSystem.Diagnostics.EventLog.SourceExists(LOG_SOURCE)) Then
EventLog.CreateEventSource(LOG_SOURCE, LOG_NAME)
End If
el = New EventLog(LOG_NAME)
el.Log = LOG_NAME
el.Source = LOG_SOURCE
el.WriteEntry(LOG_SOURCE, "LogWorker succeeded in writingto ServOneLog.")
End Sub
End Module