I\'m having difficulty trying to determine the cause of a timeout in a Windows Service I\'ve created with C#. I\'ve spent a considerable amount of time looking at several posts
A few things to try:
Add log messages to the top of Main()
, before ServiceBase.Run()
, etc. Assuming you get a log file, how do those timestamps compare to the Windows Event Log?
Create a brand new Service with the New Project Wizard and deploy it as-is. On the problem machines, does it start reliably?
Get process monitor and watch a normal startup. Look for any unexpected network or file I/O.
Make sure your SchedulerService
does not do any work in the constructor, and does not have any statically-initialized dependencies.
Set the Recovery options to restart on first failure. Does that work reliably?