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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:10:34+00:00 2026-05-21T22:10:34+00:00

I am working on Windows Service. It works fine. When i am trying to

  • 0

I am working on Windows Service. It works fine. When i am trying to stop the service from services.msc, it throws the following error:

Windows could not stop the xxx service on Local Computer.
The service did not return an error. This could be an internal Windows error or an internal service error.
If the problem persists, contact your system administrator.

If I try to stop it again, it takes lots of time and then throws the error as below:

Windows could not stop the xxx service on Local Computer.
Error 1061: The service cannot accept control messages at this time.

At this point, the service has stopped. But if I try to reinstall the service, it throws another error:

Windows could not stop the xxx service on Local Computer.
Error 1001: The specified service is marked for deletion.

After closing services.msc, it lets me reinstall the service and again things start working fine.

In OnStop(), I am doing some lengthy operations and it takes time to complete.

Any idea how I can make the whole thing go smoothly?

–Edit–

This is what my OnStop method looks like:

protected override void OnStop()
{
    base.OnStop();
    //Some lengthy operation      
}
  • 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-05-21T22:10:35+00:00Added an answer on May 21, 2026 at 10:10 pm

    The windows service have a default timeout in onstart and onstop events. Normally if you are doing time consuming operations in any of these events start a new thread and let the operation to perform in background.

    Usually the OnStart as well as OnStop events within the windows service are used to initiate a process and the time consuming process will carryout it’s execution within a child thread.

    Hope this will solve your issue..

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

Sidebar

Related Questions

I'm trying to get log4net working for a Windows service. It works fine for
I am posting XmlDocument to ApiController (from windows service, service is working fine, it
I am trying to restart a windows service (part of the application) from my
I have modified a working Windows service that had always been starting beforehand. After
I'm working on a Windows Service that's having some issues with Thread.Sleep() so I
I'm working on creating a windows service that will send emails to a customer
I have a service, as follows: The most basic (working) CherryPy 3.1 Windows service
I'm working on Windows phone client for one service with Oauth1 API. In API
I have a working WCF service. I want to deploy it on Windows Azure.
I am working in Windows Application. I am reading a value from Excel and

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.