windows service takes longer than 30 seconds to start RRS feed

  • Question

  • Hi,

    We're using WinXP and .Net 3.5

    We have a windows service that (sometimes) takes longer than 30 seconds to start.  Is there a way to signal the the SCM to hold on, and not time out after 30 seconds in an automatic start?  (we see this on a reboot only.  After reboot, it usually takes 15-20 seconds to start)

    If this isnt possible, i think we could spin off this functionality to a separate thread and have the service start quickly.  Not sure this is the best idea, because our customers think that once it's started, it's immediately ready to go.  

    Thanks! :)
    • Edited by Steve1999 Tuesday, June 10, 2008 6:44 PM reword
    Tuesday, June 10, 2008 6:39 PM


  • Try to use the ServiceBase.RequestAdditionalTime() method in your OnStart() method.
    Hans Passant.
    • Proposed as answer by Somnath Paul Wednesday, June 11, 2008 4:13 AM
    • Marked as answer by nobugz Sunday, June 15, 2008 4:34 PM
    Tuesday, June 10, 2008 6:57 PM