C# Windows Service Timeout on startup

后端 未结 5 450
小鲜肉
小鲜肉 2021-02-05 11:41

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

5条回答
  •  星月不相逢
    2021-02-05 12:27

    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?

提交回复
热议问题