We've got some Windows services written in .NET. They start fine manually within the services mmc, but despite being set to Automatic, they never start when powering on (or rebooting) the machine.

Update In the event log, instead of seeing "xyz started", alongside all the other services starting, I just see "The xyz service entered the stopped state." and a seperate error that says "A timeout (30000 milliseconds) was reached while waiting for a transaction response from the slsvc service.".

If I manually start them, then I get a normal in the event log as expected, and all is fine - until the next Windows Update patch which forces a reboot and all the services are off again.

Any ideas? I've tried setting them to Delayed Start with no apparent difference.

link|improve this question
I once had a very similar problem with some scheduled tasks, which I eventually discovered I could recreate by changing the username the task ran as after it had been created. I found that I could easily fix the problem by simply deleting and re-creating the tasks. It is definitely worth a similar approach with this - try removing the service and recreating it. This may help if your not sure how to do that. FYI, the scheduled tasks problem doesn't happen any more, I guess some update at some point fixed it. – DaveRandom Jan 5 at 16:42
I'm wondering if they are failing to start because they are dependent on another service (which hasn't started yet). Are you able to see a service start failure within the system log? – newmanth Jan 9 at 22:00
@DaveRandom the reinstall actually happens each time we deploy a new version, so it doesn't appear that removing/adding solves the problem unfortunately – James Crowley Jan 16 at 8:45
@newmanth question updated with some new details - turns out there were event log entries that I'd missed – James Crowley Jan 16 at 8:49
I noticed in your comment to Rob's answer that .NET is the only dependency. Do you know if the developers used any third-party APIs in the service's development? If so, perhaps there is some licensing mechanism that is being blocked? – newmanth Jan 16 at 14:55
feedback

1 Answer

What do you mean when you say "we've got some Windows services"? That suggest to me that they're created internally by someone within your organisation? If so then you're in a better position to debug them than anyone else here - what dependencies do these services have on windows components and are your programmers considered testing for the availability of these services and waiting for them to come online when your services start?

Have you considered setting these services as a dependency of the software licensing service (that's what slsvc is)?

from http://support.microsoft.com/kb/193888

To create a new dependency, select the subkey representing the service you want to delay, click Edit, and then click Add Value. Create a new value name "DependOnService" (without the quotation marks) with a data type of REG_MULTI_SZ, and then click OK. When the Data dialog box appears, type the name or names of the services that you prefer to start before this service with one entry for each line, and then click OK.

The name of the service you would enter in the Data dialog box is the exact name of the service as it appears in the registry under the Services key.

When the computer starts, it uses this entry to verify that the service or services listed in this value are started before attempting to start the dependent service.

link|improve this answer
Thanks Rob - they are internal - but the only dependency is the .NET framework, which I don't believe runs as a service. It doesn't require anything else at startup... – James Crowley Jan 16 at 10:22
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.