我已经写了:
.
.
.
//Log exception to the event log
if (!EventLog.SourceExists("PodaHIS")) {
EventLog.CreateEventSource("PodaHIS", "Application");
}
EventLog eventLog = new EventLog();
eventLog.Log = "Application";
eventLog.Source = "PodaHIS";
eventLog.WriteEntry(error.ToString(), EventLogEntryType.Error);
我还启用了对 LOCALMACHINE\ASPNET 的读取权限。
作为回报,我得到:
The source was not found, but some or all event logs could not be searched. Inaccesible logs: Security.
有谁知道为什么会这样?