Click here to Skip to main content
15,911,306 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have done a windows service in c# but I'm having error since I started the service. I have searched for the solution but I couldn't find one yet.
If anyone faced with the same problem please help me.
The error says:

error 1053 the service did not respond to the start or control request in a timely fashion

Thanks in advance
Posted

1 solution

In the services OnStart handler you are either taking to long (max 30 secs)
or even never exit. Please use OnStart only to instantiate your service model and fire up the service's main thread. If the building process for the services model is to convoluted it might also take too long. In that case you should only start a thread that will build your service model and then start the services main thread.


Cheers


Manfred
 
Share this answer
 
Comments
kubi081 13-Dec-10 5:26am    
Thanks that was it, I had an infinite loop inside the service.
But now I see that my service is not running as I wanted and tested in console application.
What I want is
to select a folder,
to run a .bat file,
choose preferences from the app (with SendKeys method),
run that application,
check if success windows is opened,
close that window,
close open application folders,

So I'm using Windows.Forms namespace .
When I tested it in Console app. It works great but same codes doesn't work in service application!

Do you have any idea for this ?

Thanks
Manfred Rudolf Bihy 13-Dec-10 6:20am    
Did you enable "Interact with desktop" for your service?
Why are you trying to do this as a service?
How often will this run?
What will happen if no user is logged on?
You'll have to sort out these questions before proceeding any further.
kubi081 13-Dec-10 8:40am    
Thanks for quick reply.
Now It works for first step of procedure !!

What we want to do is to get updated config xml file which is almost 60MB of size.
We need to update sql server database tables according to this xml file.
Because of xls files are easy to query in c#,
We're using a program to convert those xml files to xls files.
After the xls file is created we're querying the tables.

We need to do this without any intervention.
Maybe for every 4 hours.

But now in Service SendKeys method doesn't work!!

Do you have any suggestion for this process?

Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900