tags:

views:

24

answers:

1

Hey guys,

I'm trying to debug a service to tries to start but is immediatly stopped. I'm integrating an eventlogtracelistener, and tested it on my pc. When i start the service, i get 5 logs in my eventviewer. One is even the first thing it calls. When i install my service on the server, and try to start it, i don't get even 1 log in evenlogs and as i said before, i starts, takes 1 second and then stops automatically.

Doesn't my service has the rights to write to eventlog?

Thanks in advance.

A: 

Are you creating a new event log source ? If yes, you need to be an admin to do this. If the service runs under a non-admin account, it will fail before writing anything.

The normal way to solve this (if this is the problem) is to create the sources in your setup program (as it is run by an admin).

Timores
how would i create that in the setup?
djerry
System.Diagnostics.EventLog.CreateEventSource will do that for you.
Timores