I am running this code under an account that is an Administrator:
if (EventLog.Exists("AppName") == false)
EventLog.CreateEventSource("AppName", "Application"); // exception here
It throws a SecurityException:
"The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security."
I can write events to the EventLog without doing this but it includes this crappy looking text in the log:
"The description for Event ID 0 from source Application cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer."
What am I missing?