>>SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.] >> System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly) +706 >> System.Diagnostics.EventLog.SourceExists(String source, String machineName) +101 >> System.Diagnostics.EventLog.VerifyAndCreateSource(String sourceName, String currentMachineName) +69 >> System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +211 >> System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type) +14 >>>
string MyAppName = "MyAppName"; EventLog.CreateEventSource( MyAppName, MyAppName);I know this does not look right but I found a document on the web that has this syntax, two parameters and both are the same.