By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,116 Members | 1,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,116 IT Pros & Developers. It's quick & easy.

1053 error trying to start my .NET windows service

P: n/a
Hi I have written a windows service in C# / .NET
I have installed it and it's working fine on a couple boxes but on my XP box
I get this error when I try to start it:

Error 1053: The service did not respond to the start or control request in a
timely fashion.

I understand that the scm issue the start and is supposed to put up this
error after some timeout period but it's coming up after only about half a
second and it doesnt even appear to have loaded my assembly. Note that it
only takes a couple seconds to start on the boxes that it works on.

Googling has only turned up actually taking too long or eventlog full as
causes. It fails identically for me with an empty eventlog...

I suspect there's some service registration corruption or something behind
this. Has anyone run into this before and resolved it?

thanks :-)
-john
Apr 24 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
PS I forgot to note that I am just running this service in the standard Local
System account and I'm trying to log to the eventlog first thing in cctor.
The log message never shows up. I have another service that also runs as
Local System and can log to the event log fine.
thanks again :-)
-john
Apr 24 '07 #2

P: n/a
Hi John,

Here's my understanding of the issue so far, please feel free to correct me
if I've misunderstood anything:

1) This is an environment specific issue, which means it only occurs on a
specific system
2) You're not sure if the service assembly gets executed or not since the
error occurs real quick after you try to start it
Well, I think we need to first make sure if the assembly gets executed or
not: if it's not, then it's obviously a service configuration problem; we
will have to look elsewhere. If it's executed but immediately exits, then
we need to debug the application to see why it fails. To determine that, we
could use Process Monitor
(http://www.microsoft.com/technet/sys...eads/processmo
nitor.mspx) to monitor the file/registry access to see if there's any error.

To debug a service's startup code, please refer to following article:

#DebugInfo.com - Debugging startup code of services and COM servers
http://www.debuginfo.com/articles/debugstartup.html
Please reply here to let me know the result on your side. Thanks.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 25 '07 #3

P: n/a


"Walter Wang [MSFT]" wrote:
Hi John,

Here's my understanding of the issue so far, please feel free to correct me
if I've misunderstood anything:

1) This is an environment specific issue, which means it only occurs on a
specific system
2) You're not sure if the service assembly gets executed or not since the
error occurs real quick after you try to start it
Well, I think we need to first make sure if the assembly gets executed or
not: if it's not, then it's obviously a service configuration problem; we
will have to look elsewhere. If it's executed but immediately exits, then
we need to debug the application to see why it fails. To determine that, we
could use Process Monitor
(http://www.microsoft.com/technet/sys...eads/processmo
nitor.mspx) to monitor the file/registry access to see if there's any error.

To debug a service's startup code, please refer to following article:

#DebugInfo.com - Debugging startup code of services and COM servers
http://www.debuginfo.com/articles/debugstartup.html
Please reply here to let me know the result on your side. Thanks.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 25 '07 #4

P: n/a
Hi Walter,

Thats correct but with the exception that it's not specific to just one
machine. I have tried it on a couple different machines with XP and it has
failed identically on both. I have had success on W2K3, Vista, and Vista.x64.

I installed process monitor and btw thanks for that tip I'm sure it will
come in handy for many other things as well. Not exactly sure what to look
for in the very long output but the one thing that did catch my eye was that
by service process does get loaded and it looks like it's config file gets
read and some dlls get loaded but I don't think it ever gets to my entry
point. The process exit code is 80131700 which error lookup doesn't find but
google suggests that it means the shim couldnt load the CLR.
I fear this is as misleading as the scm "did not start in a timely fashion"
error message because I have 1.0, 1.1, 2.0, and 3.0 on there, all patched
current. I built my service with VS2005, nothing special like MSBee so it
should target 2.0.50727. I can run other apps built with it fine and even run
this one fine as a console app if I add in a dummy main and have it new my
service class and call onstart on it. I can send you the process monitor
capture log if youd like to dig deeper.

I am proceeding to the IFEO stuff but it will take some time as I dont have
VS on that box... argh... :-)

thanks again for your help!
-john

"Walter Wang [MSFT]" wrote:
Hi John,

Here's my understanding of the issue so far, please feel free to correct me
if I've misunderstood anything:

1) This is an environment specific issue, which means it only occurs on a
specific system
2) You're not sure if the service assembly gets executed or not since the
error occurs real quick after you try to start it
Well, I think we need to first make sure if the assembly gets executed or
not: if it's not, then it's obviously a service configuration problem; we
will have to look elsewhere. If it's executed but immediately exits, then
we need to debug the application to see why it fails. To determine that, we
could use Process Monitor
(http://www.microsoft.com/technet/sys...eads/processmo
nitor.mspx) to monitor the file/registry access to see if there's any error.

To debug a service's startup code, please refer to following article:

#DebugInfo.com - Debugging startup code of services and COM servers
http://www.debuginfo.com/articles/debugstartup.html
Please reply here to let me know the result on your side. Thanks.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 25 '07 #5

P: n/a
Another interesting thing was that it looks in the registry under
HKLM\System\CurrentControlSet\Hardware Profiles
0001\System\CurrentControlSet\Enum\Root\LEGACY_xxx x\0000
where xxxx is my service name. I entered no such key. Could it be a
coincidence that there's a legacy service with the same name or is this from
previous installs that failed do to the service not starting?

thank :-)

"John.NET" wrote:
Hi Walter,

Thats correct but with the exception that it's not specific to just one
machine. I have tried it on a couple different machines with XP and it has
failed identically on both. I have had success on W2K3, Vista, and Vista.x64.

I installed process monitor and btw thanks for that tip I'm sure it will
come in handy for many other things as well. Not exactly sure what to look
for in the very long output but the one thing that did catch my eye was that
by service process does get loaded and it looks like it's config file gets
read and some dlls get loaded but I don't think it ever gets to my entry
point. The process exit code is 80131700 which error lookup doesn't find but
google suggests that it means the shim couldnt load the CLR.
I fear this is as misleading as the scm "did not start in a timely fashion"
error message because I have 1.0, 1.1, 2.0, and 3.0 on there, all patched
current. I built my service with VS2005, nothing special like MSBee so it
should target 2.0.50727. I can run other apps built with it fine and even run
this one fine as a console app if I add in a dummy main and have it new my
service class and call onstart on it. I can send you the process monitor
capture log if youd like to dig deeper.

I am proceeding to the IFEO stuff but it will take some time as I dont have
VS on that box... argh... :-)

thanks again for your help!
-john

"Walter Wang [MSFT]" wrote:
Hi John,

Here's my understanding of the issue so far, please feel free to correct me
if I've misunderstood anything:

1) This is an environment specific issue, which means it only occurs on a
specific system
2) You're not sure if the service assembly gets executed or not since the
error occurs real quick after you try to start it
Well, I think we need to first make sure if the assembly gets executed or
not: if it's not, then it's obviously a service configuration problem; we
will have to look elsewhere. If it's executed but immediately exits, then
we need to debug the application to see why it fails. To determine that, we
could use Process Monitor
(http://www.microsoft.com/technet/sys...eads/processmo
nitor.mspx) to monitor the file/registry access to see if there's any error.

To debug a service's startup code, please refer to following article:

#DebugInfo.com - Debugging startup code of services and COM servers
http://www.debuginfo.com/articles/debugstartup.html
Please reply here to let me know the result on your side. Thanks.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Apr 25 '07 #6

P: n/a
Ok I tried the IFEO trick and verified that my code is never getting entered.
The vsjitdebugger comes up, I choose my already opened one with the break
points already set, and see it go into the running state. But after a second
or two it subsequently stops debugging without ever having hit any of my
breakpoints (cctor, ctor, OnStart)

"John.NET" wrote:
Hi Walter,

Thats correct but with the exception that it's not specific to just one
machine. I have tried it on a couple different machines with XP and it has
failed identically on both. I have had success on W2K3, Vista, and Vista.x64.

I installed process monitor and btw thanks for that tip I'm sure it will
come in handy for many other things as well. Not exactly sure what to look
for in the very long output but the one thing that did catch my eye was that
by service process does get loaded and it looks like it's config file gets
read and some dlls get loaded but I don't think it ever gets to my entry
point. The process exit code is 80131700 which error lookup doesn't find but
google suggests that it means the shim couldnt load the CLR.
I fear this is as misleading as the scm "did not start in a timely fashion"
error message because I have 1.0, 1.1, 2.0, and 3.0 on there, all patched
current. I built my service with VS2005, nothing special like MSBee so it
should target 2.0.50727. I can run other apps built with it fine and even run
this one fine as a console app if I add in a dummy main and have it new my
service class and call onstart on it. I can send you the process monitor
capture log if youd like to dig deeper.

I am proceeding to the IFEO stuff but it will take some time as I dont have
VS on that box... argh... :-)

thanks again for your help!
-john

"Walter Wang [MSFT]" wrote:
Hi John,

Here's my understanding of the issue so far, please feel free to correct me
if I've misunderstood anything:

1) This is an environment specific issue, which means it only occurs on a
specific system
2) You're not sure if the service assembly gets executed or not since the
error occurs real quick after you try to start it
Well, I think we need to first make sure if the assembly gets executed or
not: if it's not, then it's obviously a service configuration problem; we
will have to look elsewhere. If it's executed but immediately exits, then
we need to debug the application to see why it fails. To determine that, we
could use Process Monitor
(http://www.microsoft.com/technet/sys...eads/processmo
nitor.mspx) to monitor the file/registry access to see if there's any error.

To debug a service's startup code, please refer to following article:

#DebugInfo.com - Debugging startup code of services and COM servers
http://www.debuginfo.com/articles/debugstartup.html
Please reply here to let me know the result on your side. Thanks.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Apr 25 '07 #7

P: n/a
Hi John,

Based on above information so far, it looks like an assembly loading
problem; there might be some dependent assembly not loaded when running
under SCM.

Try to use the fusion log:

#Assembly Binding Log Viewer (Fuslogvw.exe)
http://msdn2.microsoft.com/en-us/lib...c4(VS.71).aspx

#Suzanne Cook's .NET CLR Notes : Debugging Assembly Loading Failures
http://blogs.msdn.com/suzcook/archiv.../29/57120.aspx

You can also send me the Process Monitor's log for inspection. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 26 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.