![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | .net Windows Service Won't Start - Timeout I've written a .net Windows service in C#. It works most of the time for most people. It is configured to automatically start when Windows boots. Sometimes it fails to start on Windows XP during boot. All I know is that it is timing out. But no useful details appear in the event log, not even my first EventLog message in OnStart. How can I figure out why it isn't starting? How can I fix this? My ServiceBase constructor just sets a few properties. The first few lines of OnStart are... EventLogTraceListener logListener = new EventLogTraceListener("TimesUpKidz"); Trace.Listeners.Add(logListener); try { Trace.WriteLine("Starting"); } catch { } This message does not show up in the EventLog. The log is nearly empty, so there is no chance of it being full and losing messages. These are two errors in the System EventLog: Timeout (30000 milliseconds) waiting for the TimesUpKidz service to connect. Service Control Manager Error Event ID 7009 The TimesUpKidz service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion. Service Control Manager Error Event ID 7000 One theory I have is that maybe it is taking a very long time to load the ..net plumbing. I made my service dependent on: winmgmt (Windows Management Instrumentation) termservice (Terminal Services) The service uses Remoting. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: .net Windows Service Won't Start - Timeout Have you tried to write your log to a regular file instead of to the eventlog ? Just to see if maybe the eventlog is the problem, maybe it's unavailable. Jurjen. "jmagaram" <jmagaram@xxxxxx> wrote in message news:B6DBA61B-08D8-4C55-AACF-AB682D79C889@xxxxxx Quote: > I've written a .net Windows service in C#. It works most of the time for > most > people. It is configured to automatically start when Windows boots. > Sometimes > it fails to start on Windows XP during boot. All I know is that it is > timing > out. But no useful details appear in the event log, not even my first > EventLog message in OnStart. How can I figure out why it isn't starting? > How > can I fix this? > > My ServiceBase constructor just sets a few properties. The first few lines > of OnStart are... > > EventLogTraceListener logListener = new > EventLogTraceListener("TimesUpKidz"); > Trace.Listeners.Add(logListener); > try { Trace.WriteLine("Starting"); } catch { } > > This message does not show up in the EventLog. The log is nearly empty, so > there is no chance of it being full and losing messages. > > These are two errors in the System EventLog: > > Timeout (30000 milliseconds) waiting for the TimesUpKidz service to > connect. > Service Control Manager Error Event ID 7009 > > The TimesUpKidz service failed to start due to the following error: > The service did not respond to the start or control request in a timely > fashion. > Service Control Manager Error Event ID 7000 > > One theory I have is that maybe it is taking a very long time to load the > .net plumbing. I made my service dependent on: > > winmgmt (Windows Management Instrumentation) > termservice (Terminal Services) > > The service uses Remoting. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: .net Windows Service Won't Start - Timeout jmagaram wrote: Quote: > I've written a .net Windows service in C#. It works most of the time for most > people. It is configured to automatically start when Windows boots. Sometimes > it fails to start on Windows XP during boot. All I know is that it is timing > out. But no useful details appear in the event log, not even my first > EventLog message in OnStart. How can I figure out why it isn't starting? How > can I fix this? > and writing events to it. http://support.microsoft.com/kb/307024 One method to debug the NT service is to enable the Messenger Service on XP. With MSG service enabled, you can put code in the NT service like in the Onstart(s) or anywhere really, using the NET Send command, format a message, shell out to the Command Prompt and issue the Net Send with message and machine-name. The NET Send will pop-up a message box on the console screen on the machine with an OK reply button. So you can pop messages to yourself like Here1 Here2 Here3 to pinpoint where the program is going down. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: .net Windows Service Won't Start - Timeout "jmagaram" <jmagaram@xxxxxx> wrote in message news:B6DBA61B-08D8-4C55-AACF-AB682D79C889@xxxxxx Quote: > I've written a .net Windows service in C#. It works most of the time for > most > people. It is configured to automatically start when Windows boots. > Sometimes > it fails to start on Windows XP during boot. All I know is that it is > timing > out. But no useful details appear in the event log, not even my first > EventLog message in OnStart. How can I figure out why it isn't starting? > How > can I fix this? http://support.microsoft.com/kb/936707 To increase the service startup timeout value, see: http://support.microsoft.com/kb/922918 |
My System Specs![]() |
| | #5 (permalink) |
| | Re: .net Windows Service Won't Start - Timeout Assuming there is something wrong with the event log, I've tried logging to a file. The first line of Main is: File.AppendAllText(@"c:\log.txt", "getting started"); This log file does not get created during restart of the operating system. If I launch the service manually later, it does get logged. I'm really stumped here. For some reason my service can't get started and times out during reboot but not when I start it manually later. "John Vottero" wrote: Quote: > "jmagaram" <jmagaram@xxxxxx> wrote in message > news:B6DBA61B-08D8-4C55-AACF-AB682D79C889@xxxxxx Quote: > > I've written a .net Windows service in C#. It works most of the time for > > most > > people. It is configured to automatically start when Windows boots. > > Sometimes > > it fails to start on Windows XP during boot. All I know is that it is > > timing > > out. But no useful details appear in the event log, not even my first > > EventLog message in OnStart. How can I figure out why it isn't starting? > > How > > can I fix this? > Do you digitally sign your executable? If so, you may have this problem: > > http://support.microsoft.com/kb/936707 > > To increase the service startup timeout value, see: > > http://support.microsoft.com/kb/922918 > > > |
My System Specs![]() |
| | #6 (permalink) |
| Vista | Re: .net Windows Service Won't Start - Timeout I am encountering the same problem. My managed service application doesn't have dependency on winmgmt or termservice though. The timeout error is reported once in a while during machine reboot, and the problem just cannot be reproduced manually. My first line of code which writes a string in EventLog in OnStart() doesn't get executed so I have no idea where the hanging problem is. My service app does use .NET Remoting IPC channel but I would doubt that matters because the .NET Remoting assembly should not have been loaded since the related code had not been executed when the hang happened. jmagaram, just wondering if you have solved the issue yet. Thanks, Frank |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| WLAN AutoConfig won't start | Windows Wireless Service won't start.... | Network & Sharing | |||
| No timeout for stop-service cmdlet? | PowerShell | |||
| Controlling service restart timeout with WMI | VB Script | |||
| Windows Service Timeout in Vista | Vista General | |||