开发者

c# windows service in windows 7 The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security

I am runing c# windows service in windows 7.i am getting this error.

{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.VerifyAndCreateSource(String sourceName, String currentMachineName) at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) at Syste开发者_如何学Cm.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) at System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID) at eFpdaDMSservice.Utils.GetRegValue(RegistryKey regKey, String strSubKey, String strName, String strDefault)

I have given permissions in the registry

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\EventLog

it is breaking at this point

strTempDir = Environment.GetEnvironmentVariable("temp");
            **strLogDir = Utils.GetRegValue(Registry.LocalMachine,REG_KEY,"logdir",strTempDir);**

Any suggestions appreciated


What account are you running the service under ? You can try to change the Account to LocalSystem and see if it fixes your problem.

c# windows service in windows 7 The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜