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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:06:58+00:00 2026-05-25T02:06:58+00:00

I am maintaining a Windows Service, which has a quite unfortunate bug. I can

  • 0

I am maintaining a Windows Service, which has a quite unfortunate bug. I can no longer debug the code because the service simply refuses to start. This is the error:

Windows could not start the MyService service on Local Computer.

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

I inserted some log-to-file lines in the main method and it never comes past the instantiation of my windows service. It stops right before the line

ServiceBase.Run(ServicesToRun);

So the Run method is never executed. I am guessing that it is the instantiation of MyService that fails. But how is that possible?

static void Main()
{
        //this line is reached

        ServiceBase[] ServicesToRun;
        ServicesToRun = new ServiceBase[] 
        { 
            new MyService() //halts here
        };

        //this line is never executed
        ServiceBase.Run(ServicesToRun);
}
  • 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-25T02:06:59+00:00Added an answer on May 25, 2026 at 2:06 am

    reposted reply from above:

    Yes, I got info in the event viewer. It was basically an unhandled exception due to the fact that I had an incorrect configuration file. The windows service is supposed to parse an XML file on instantiation, but there was a “>” sign missing, which means it wasn’t even a valid XML file. So the lesson must be to have good error handling in the constructor of a windows service. Thank you all for your help.

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

Sidebar

Related Questions

I am maintaining some code which looks something like this. It's a Windows service
I am maintaining a managed Windows Service project which basically invoke/run the (managed) jobs
I'm maintaining a Windows app that has multiple forms in the one window (
I'm maintaining a Windows CE app built with the .NET Framework that has about
I am developing/maintaining classic asp pages and asp code on a Windows 7 PC
After maintaining lots of code littered with #region (in both C# and VB.NET), it
I'm maintaining some code that uses a *= operator in a query to a
I am maintaining .net 1.1 and .net 3.5 c# code at once. For this
I'm about to write a small C# WPF service which references an XML file
I've been maintaining a Windows forms application written in C# for some time now

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.