.NET Windows Service -- timeout

Below is my exception.

My .NET windows service can take a significant amount of time to start -- sometimes, up to 300 seconds (possibly more).

ANTS profiler times out while trying to start it. The service does successfully start, but ANTS has given up the ghost.

Any workarounds for this?

Event Type: Error
Event Source: ANTS Profiler
Event Category: None
Event ID: 0
Date: 8/16/2008
Time: 2:34:32 PM
User: N/A
Computer: CA02WS05
Description:
Unable to start profiler - exception details System.Exception: Couldn't restart the service (timeout)

Server stack trace:
at RedGate.Profiler.Engine.ProfilingSession.StartProfiler()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
at System.Windows.Forms.MethodInvoker.EndInvoke(IAsyncResult result)
at _5._4(IAsyncResult )

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hi,

    Sorry to say there is now way to extend the service start timeout in ANTS Profiler: it's hard-coded at 300 seconds.

    The best suggestion I've got is to reduce the service startup time by moving some or all of the startup code into a new thread. Once you start the thread, the Windows Service Controller considers the service started once the onStart method has finished, and your startup code will continue running on a different thread.
Sign In or Register to comment.