0

I'm trying to create an event source like this:

EventLog.CreateEventSource(myApplicationName,"Application")

My application is marked as Full Trust under ClickOnce, but I still get this 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.

The documentation for this method indicates that you must either be a local admin or mark the application as Full Trust. What am I doing wrong?

LarsTech
  • 80,625
  • 14
  • 153
  • 225
  • Possible duplicate of [Problem when trying to use EventLog.SourceExists method in .NET](http://stackoverflow.com/questions/6735862/problem-when-trying-to-use-eventlog-sourceexists-method-in-net) – MaxOvrdrv Dec 22 '15 at 18:07
  • That article doesn't mention the Full Trust aspect. This is the gist of my question. – Barry Gilbert Dec 23 '15 at 03:01
  • Ok... in that case, you must give the user that your winforms app runs under full access. This is the only item i found that makes sense: http://stackoverflow.com/questions/14245345/eventlog-write-permissions – MaxOvrdrv Dec 23 '15 at 03:56
  • Thanks. It looks like the application requires Full Trust as well as being run as an administrator. – Barry Gilbert Dec 23 '15 at 14:47

0 Answers0