Microsoft Service Tutorial: Eventlog WriteEntry crashes service

  • Thread starter Thread starter dr34mup
  • Start date Start date
D

dr34mup

Guest
Hello, everybody,

I just started working on my first service app and used this tutorial for it:

Tutorial: Create a Windows service app

But after I installed and started the service, it stops immediately without writing an entry in the event log.

So I started to deal with the problem and found out that this line caused the problem:

eventLog1.WriteEntry("In OnStart.");

When I remove the line, the service starts and runs until I stop it again. But if I add the line again and reinstall the service, the same thing happens as before and the service stops. I already tried to start the service with a network user who has local admin rights - but unfortunately that didn't work. I also tried to start the service with Powershell(Administrator) and the command `net start SERVICENAME`, but it's always the same.

Any ideas?

Continue reading...
 
Back
Top