In what order to the method calls happen in a windows service? We are having a timing issue and I think it is due to the constructor taking too long to complete processing.

This is a similar issue that I think we are having Error 1053 the service did not respond to the start or control request

However, we are wonder in what order and when the methods Main, OnStart, InitializeComponent etc get called and/or when they should be called.

As well, would the OnStart method be the best place to put all of the processing?

**Solution

Made some time to make a test service and tested the responses below and found out the time out is coming from the Main method processing as well as the constructor being called in the Main method causing it to time out. Moving everything to the OnStart as well as just spinning off a thread seemed to work. Details here. http://www.adamthings.com/post/2012/06/28/error-1053-the-service-did-not-respond-to-the-start-or-control-request-in-a-timely-fashion/

Edit
Report