Has security changed with accessing the event log through a local service in
..NET 2.0? in 1.1 i did this
If Not Diagnostics.EventLog.SourceExists("BDBHOST") Then
' create log
Diagnostics.EventLog.CreateEventSource("BDBHOST", "Benefits Service")
End If
Diagnostics.EventLog.WriteEntry("BDBHOST", "The Benefits Host Process was
successfully started", EventLogEntryType.Information)
and it worked perfectly fine in the OnStart method of the service... but
when doing that in .NET 2.0 it fails with an event log entry in the
application event log saying this
Event Type: Error
Event Source: BHOSTPROC
Event Category: None
Event ID: 0
Date: 12/1/2005
Time: 2:19:12 PM
User: N/A
Computer: DT-06-BH
Description:
Service cannot be started. System.Security.SecurityException: The source was
not found, but some or all event logs could not be searched. Inaccessible
logs: Security.
at System.Diagnostics.EventLog.FindSourceRegistration (String source,
String machineName, Boolean readOnly)
at System.Diagnostics.EventLog.SourceExists(String source, String
machineName)
at System.Diagnostics.EventLog.SourceExists(String source)
at BHostProc.BHostProc.OnStart(String[] args) in
C:\temp\BHostProc.vb:line 34
at System.ServiceProcess.ServiceBase.ServiceQueuedMai nCallback(Object
state)
The Zone of the assembly that failed was:
MyComputer
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
whys it doing this now? and how do i fix it? thanks