473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

1053 error trying to start my .NET windows service

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
7 13320
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
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


"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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: 3dr | last post by:
I am developing a service which I install and run on a number of servers. It works on most machines I have installed it on, but I always get a 1053, service will not start in a timely fashion...
1
by: mtc | last post by:
I'm able to install and run a service I built on two machines - the one I built it on and another that has visual studio installed. I've installed it without problems on 3 other machines that...
6
by: Ashwin Kambli | last post by:
Hi, I am trying to write a Windows Service application using C#. I wrote a very trivial example (logs messages during Start and Stop events to the evenlog). I have no problem installing it (using...
5
by: Richard Steele | last post by:
I have created a WinForm application that needs to be run as a windows service (the PC is inaccesible by any user) i have successfully installed the application as a windows service. When i start...
2
by: 3dr | last post by:
I am developing a service which I install and run on a number of servers. It works on most machines I have installed it on, but I always get a 1053, service will not start in a timely fashion...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
1
by: magnus.s.olsson | last post by:
I have got a Windows Service application from a customer that I try to start. The customer can start it with no problem, but when I try to start it I get: "Could not start the GateWay service on...
0
by: daniel kumar | last post by:
Hi this is Daniel Kumar, I installed oracle apps11i in my system on windows enterprise 2003 edition about one week back, at that time it working properly. today when i start my computer...
0
by: DeV | last post by:
Hi, I'm running into a problem which I cannot seem to get solved. When I make my own service I have the following code: Protected Overrides Sub OnStart(ByVal args() As String) Dim t As New...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.