Error "SOME SERVICES STOP AUTOMATICALLY IF THEY ARE NOT IN USE BY OTHER SERVICES" while trying to start a windows service.
I have a service that does not use the windows service config file and uses static properties - it works fine
Now, i make use of app.config file and rebuild my setup project + the service project. Now i install the service and then try to start the service - i get the following error:
SOME SERVICES STOP AUTOMATICALLY IF THEY ARE NOT IN USE BY OTHER SERVICES
Service logs on as local system.
Any input is welcome please! Thanks.
I had the same error that was due to dll's not being created when running the installUtil.cmd on my serviceInstaller.msi. To fix this I had to include one of these =>
<File Id="Interception" Source="$(var.SourceDir)\Microsoft.Practices.Unity.Interception.dll" />
for each dll I was expecting in my project and place it in my Service.wxs file. Like this =><Fragment><DirectoryRef Id="ApplicationDirectory"><Component Id="ServiceID" Guid="$(var.ServiceGuid)"> *here* <closing tags...>
. And make sure that all the dll's are included in the installers x copy commands :)Hope this helps!
This is generally the result of one of two things - either (a) your
OnStart()
method is throwing an exception or (b) theOnStart()
method is not kicking off a thread to do work.If the problem is (a), then the obvious solution is to debug the service to identify what is going wrong. At a minimum, put a
try-catch
block around the contents of theOnStart()
method and log an error to the system event log when an exception occurs. Then you can see the details in the Windows Event Viewer.If the problem is (b), then you need to create a thread that actually does something. The thread needs to be a foreground thread (as opposed to a background thread) to prevent the service from shutting down. A typical
OnStart()
method looks like this:I got this error and it was because the hard drive had filled up. It could be anything that keeps the service from running.