Windows service won't start

  • Thread starter Thread starter Chuck Bowling
  • Start date Start date
C

Chuck Bowling

Ok, I'm not sure this is a C# question but here goes anyhow...

I used this walkthru to create a windows service:

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/vbcon/html/vbwlkwalkthroughcreatingwindowsserviceapplication.htm

It appears to install ok but when I try to start it I get this message in a
JIT Debugging window:

"JIT Debugging failed with the following error: Access is denied.
JIT Debugging was initiated by the user account: 'NT AUTHORITY\LOCAL
SERVICE'."

When I check the docs for JIT debugging errors it tells me to check that I'm
in the Debuggers Group which I am.

Anybody got a clue as to what's wrong and how I can fix it?
 
When writing services what I normally do is write the core code in a
separate assembly (DLL), then have two front ends, one being a windows
service, and another a simple dialog or better, a console. This allows me to
check that the code works fine and that it's not a windows service problem.

Basically the point I'm getting at is, are you sure it's something to do
with the windows service layer of the application, or could it be
permissions in the core code?
 
Well, the particular service that I posted I didn't run as a console app.
But, before doing the walkthru I did another windows service with exactly
the same problem. I developed it just the way you suggested below. Created a
console app and used it to debug all the code. Then I transferred the code
to a service and installed it. The result was the same as below...

The code in the walkthru is pretty simple. Basically all it does is write to
an EventLog in both the OnStart and OnStop methods.
 
What happens if you change the user account under which the service runs?

Set it to Administrator for example, then try a user with less priviledges
if that works until you find a point where it stops.

I've known systems where the local service user doesn't have access to write
to the event log.
 
Back
Top