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 8026849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:37:10+00:00 2026-06-04T23:37:10+00:00

I followed the instructions in the marked answer here to create a service. The

  • 0

I followed the instructions in the marked answer here to create a service. The service gets installed correctly. When I start the service after a while it throws a message
“Windows could not start the xxx service on Local Computer.

Error 1053: The service did not respond to the start or control request in a timely fashion.
“

After I click ok, its status stays at “Starting” for ever. When I checked the application and system logs, there were no errors.

When I check the SQL trace, the service is actually running correctly and doing what its supposed to do. So why does its status stay at “Starting” ?

Update:
This is the code in OnStart method

 protected override void OnStart(string[] args)
        {

            Loader loader = new Loader();
            loader.StartProcess();
        }

Update 2:

based on WiktorZychla’s comment I did this and it worked 🙂

protected override void OnStart(string[] args)
        {

            Loader loader = new Loader();

            ThreadStart threadDelegate = new ThreadStart(loader.StartProcess);
            Thread newThread = new Thread(threadDelegate);
            newThread.Start();

        }
  • 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-04T23:37:11+00:00Added an answer on June 4, 2026 at 11:37 pm

    Based on WiktorZychla’s comment this is what I did

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Linq;
    using System.ServiceProcess;
    using System.Text;
    using IndexLoader;
    using System.Threading;
    
    namespace myNameSpace
    {
        public partial class LoaderService : ServiceBase
        {
            Thread newThread;
            public LoaderService()
            {
                InitializeComponent();
            }
    
            protected override void OnStart(string[] args)
            {
    
                Loader loader = new Loader();
    
                ThreadStart threadDelegate = new ThreadStart(loader.StartProcess);
                newThread = new Thread(threadDelegate);
                newThread.Start();
    
            }
    
            protected override void OnStop()
            {
                if ((newThread != null) && (newThread.IsAlive))
                {
    
    
                    Thread.Sleep(5000);
                    newThread.Abort();
    
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I followed the instructions here http://support.microsoft.com/kb/825532 After that when I preview my page, I
I followed the instructions here on how to create an Android library project, and
I followed these instructions while trying to get remote debugging working with Delphi 2007.
I followed these instructions here: http://logback.qos.ch/consolePlugin.html I have the correct and found logback.xml, it
I followed the instructions: create the bean. This bean is for an enum transferred
I followed the instructions found here to get my rails app to communicate with
I've followed the instructions Google has provided on downloading the Source Tree, but after
I followed the instructions here to delete a binary file from my repo using
I just followed these instructions to get pear installed on mac os x lion:
I have followed the instructions at http://www.javacodegeeks.com/2011/01/advanced-smartgwt-tutorial-part-1.html and tried to create a simple screen

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.