How do you prevent .NET service timeout while waiting on a dependent service

I have a C # based service that depends on an MSMQ service. In some scenarios, the MSMQ service takes a long time, which appears to be causing the C # service to time out. How can I fix this programmatically?

Edit: It looks like the bug report I was working on was wrong, the service does start eventually. I'm sorry for the confusion

+1


source to share


1 answer


Typically, waiting for the queue should be done in a separate thread that should run directly in the OnStart method for the Service. If you do this, the Start command will complete successfully and the service will not be disabled.



+3


source







All Articles