Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8158061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:29:45+00:00 2026-06-06T17:29:45+00:00

In what order to the method calls happen in a windows service? We are

  • 0

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/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:29:46+00:00Added an answer on June 6, 2026 at 5:29 pm

    Do not block in the OnStart() method. It sounds like you are doing this.

    Create a separate thread in the OnStart() method and get out of there.

    I haven’t tested this, but something similar to:

    protected override void OnStart(string[] args)
    {
        var worker = new Thread(DoWork);
        worker.IsBackground = false;
        worker.Start();
    
        base.OnStart(args);
    }
    
    private void DoWork()
    {
        while (!_stopRequested)  // (set this flag in the OnStop() method)
        {
            // processing goes here
        }
    }
    

    To answer your question about the order of events, just setup Trace statements in each method. I’m not sure how helpful that will be. The message (The service did not respond to the start request …) you are getting is indicative of blocking (or taking too long) in a method that should execute relatively quickly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Do you use the alias method in order to add more ways to call
I'm trying to add a method to the Event prototype. In order to call/set
I'm trying to test an Order entity method called AddItem and I'm trying to
Does ruby or rails provide a method to order strings in a specified order?
My current method is this: SELECT TOP 1 ID FROM DATAENTRY ORDER BY ID
Method chaining is the practice of object methods returning the object itself in order
I'm using PDO method in my PHP page to implode two strings (in order
I'm trying to order the results of the get_list_or_404 method get_list_or_404(...).order_by('name') doesn't seem to
I've created a custom method called checkout in my app. I create an order
I have a nice fast task scheduling component (windows service as it happens but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.