C# Windows Service Timeout on startup

后端 未结 5 444
小鲜肉
小鲜肉 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:21

    In general, spawning a background thread from OnStart is the right thing to do.

    For troubleshooting purposes, you could try to give your service more startup time by calling RequestAdditionalTime method from OnStart. Also, you might want to check if any messages have been written to the Windows EventLog (log "Application", the source should be your service name).

提交回复
热议问题