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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:01:05+00:00 2026-05-16T05:01:05+00:00

I’m developing a service using .NET on Windows platforms. It had worked until yesterday…

  • 0

I’m developing a service using .NET on Windows platforms.

It had worked until yesterday… but today it doesn’t want to start!!! It seems strange, and I feel I’m missing something…

I’ve also tried to revert sources to the last working version, but nothing else happens: net start outputs:

The service is not responding to the control function.

What could cause this malfunction?


Probably most of you wants to know more about it. So, let me show you some code:

The service code:

#if DEBUG
class iGeckoService : DebuggableService
#else
class iGeckoService : ServiceBase
#endif
{
    static void Main()
    {
#if DEBUG
        if (Debugger.IsAttached == true) {
            DebuggableService[] services = Services;

            // Create console
            AllocConsole();

            // Emulate ServiceBase.Run
            foreach (DebuggableService service in services)
                service.Start(null);

            // Wait for new line
            Console.WriteLine("Press ENTER to exit..."); Console.ReadLine();

            // Emulate ServiceBase.Run
            foreach (DebuggableService service in services)
                service.Stop();
        } else
            ServiceBase.Run(Services);
#else
        ServiceBase.Run(Services);
#endif
    }

#if DEBUG

    static DebuggableService[] Services
    {
        get {
            return (new DebuggableService[] { new iGeckoService() });
        }
    }

    [DllImport("kernel32")]
    static extern bool AllocConsole();

#else

    static DebuggableService[] Services
    {
        get {
            return (new ServiceBase[] { new iGeckoService() });
        }
    }

#endif

    #endregion

    #region Constructors

    /// <summary>
    /// Default constructor.
    /// </summary>
    public iGeckoService()
    {
        // Base properties
        ServiceName = DefaultServiceName;

        // Service feature - Power events
    }

    #endregion

    protected override void OnStart(string[] args)
    {
        try {
            ...

        } catch (Exception e) {
            sLog.Error("Unable to initialize the service. Request to stop.", e);
        }
    }

    /// <summary>
    /// Stop this service.
    /// </summary>
    protected override void OnStop()
            {
                     ...
            }
  }

  [RunInstaller(true)]
public class iGeckoDaemonInstaller : Installer
{
    /// <summary>
    /// Default constructor.
    /// </summary>
    public iGeckoDaemonInstaller()
    {
        ServiceProcessInstaller spi = new ServiceProcessInstaller();
        spi.Account = ServiceAccount.LocalSystem;

        ServiceInstaller si = new ServiceInstaller();
        si.ServiceName = iGeckoService.DefaultServiceName;
        si.StartType = ServiceStartMode.Automatic;

        Installers.AddRange(new Installer[] {spi, si});
    }
}

class DebuggableService : ServiceBase
{
    public void Start(string[] args) { OnStart(args); }
}

The start script is:

installutil ..\bin\Debug\iGeckoService.exe
net start "Gecko Videowall"

while the stop script is:

net stop "Gecko Videowall"
installutil /u ..\bin\Debug\iGeckoService.exe

However, I think it is a system setting, since the application has worked well until the last day. (Sigh).


Update

When the service was working, I used log4net for logging service activity (I’m unable to attach the debugger to the running service…), and it has always logged.

From now, the log4net log it is never created (even if I enable internal debug option), even if I log at the Main routine!


Another update

It seems that the application is never executed. I’ve reduced every routine (Main, OnStart, OnStop), and I run an empty service. OnStart routine creates a file on a directory (fully writeable by everyone), but when the service is started, no file is created.


Yet another update

Stimulated by the Rob’s comment, I’ve seen this message on the event viewer:

> Faulting application name: iGeckoService.exe, version: 1.0.0.0, time stamp: 0x4c60de6a
> Faulting module name: ntdll.dll, version: 6.1.7600.16385, time stamp: 0x4a5be02b
> Exception code: 0x80000003
> Fault offset: 0x000000000004f190
> Faulting process id: 0x1258
> Faulting application start time: 0x01cb384a726c7167
> Faulting application path: C:\Users\Luca\Documents\Projects\iGeckoSvn\iGeckoService\bin\Debug\iGeckoService.exe
> Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
> Report Id: b096a237-a43d-11df-afc4-001e8c414537

This is, definitively, the reason on the service shutdown… not question becomes: “How to debug it?” (Thank you Rob, I’ve never thought about the event viewer until now!)
Debugging it running as console application it doesn’t show any error, indeed it seems related to the service environment. The only thing that comes to my mind could be some DLL loading failure, since now the service is empty… any idea?

(Thank you all for following me… I’d like to offer you pizza & beer)


Solved!

The service was unable to start since a crash before the Main routine, caused by the installation and the setup of the MS Application Verifier (x64). After having uninstalled that application, everything worked as usual!

Thank you all!

  • 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-16T05:01:08+00:00Added an answer on May 16, 2026 at 5:01 am

    In general every service must do following two simple things

    • if the service manager send him a control code like SERVICE_CONTROL_START, SERVICE_CONTROL_STOP and so on if should return in a short interval. Using SetServiceStatus function service can prolong this interval for example with calling SetServiceStatus with incremented dwCheckPoint value. (In .NET use can use ServiceBase.RequestAdditionalTime instead)
    • every service must answer to SERVICE_CONTROL_INTERROGATE control code just with return. This control code are used from the service manager to detect whether the service still living.

    If your program don’t follow one of the rules you receive the error “The service is not responding to the control function.”

    If you write a program in .NET you don’t need to do directly the two things which I described before. The ServiceBase class do there for you. Nevertheless you can easy break this rules if create a thread running with priority higher as normal or if you do some too long work inside an OnXXX handle (OnStop, OnStart, OnPowerEvent etc) without calling of ServiceBase.RequestAdditionalTime. Some other tricks with additional threads can also make problems.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I need to clean up various Word 'smart' characters in user input, including 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.