Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First, make sure you app code runs OK when not set up as a service. If your code runs OK when not set up as a service, my guess is that your <code>OnStart</code> is taking too long for some reason. If you cannot speed it up, the info here allows you to handle necessary startup latency.</p> <p>In Win32, you have to update the <a href="http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontrollerstatus.aspx" rel="nofollow">service status</a> by notifying the Service Control Manager (SCM) of startup (and stop) progress periodically, or it will think your service is hung and kill it. You may need to do this only once, or on a timer if your initialization takes a long time. While your startup (stop) logic is in progress, you tell SCM you are in state START_PENDING (STOP_PENDING) and once it's done you tell it you are in STARTED (STOPPED) state.</p> <p>In the managed world, this goal is achieved by calling <a href="http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicebase.requestadditionaltime.aspx" rel="nofollow">ServiceBase.RequestAdditionalTime</a>. There is a thorough overview of this topic <a href="http://blogs.msdn.com/b/bclteam/archive/2009/02/19/in-depth-how-net-managed-services-interact-with-the-servicecontrolmanager-scm-kim-hamilton.aspx" rel="nofollow">here</a>. The money quote:</p> <blockquote> <p>This is where your managed service needs to pay attention to avoid the SCM flagging your service as unresponsive.</p> <ul> <li>You don’t have to explicitly update the state; ServiceBase does this for you when your OnStart or OnStop method completes </li> <li>You do have to call RequestAdditionalTime if you expect the OnX method to exceed the timeout.</li> </ul> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload