473,413 Members | 2,066 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,413 software developers and data experts.

Windows Service - Error 1053

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 the service, i get the
following error

Error 1053: The service did not respond to the start or control request in a
timely fashion
1. Is there anyway to extend the timeout period.? I use timed threads to
load a serial device driver and this takes time

2. To enable the service to act correctly i assume that the application must
have OnStart and Stop methods. As the Winforms app already inherits
Windows.Forms.Form, how do i also make it inherit
System.ServiceProcess.ServiceBase so I can correctly start and stop (there
are cleanup operations on close)

Thank you for your help in this matter

..Net Framework v 1.1.4322.573
Nov 16 '05 #1
5 14095
Hi Richard,

This not an anser to your question but more of a help
question.
I too have tried to create a WinForm windows service biut
have not be able to. Can you please tell me how to do
this??

-----Original Message-----
I have created a WinForm application that needs to be run as a windowsservice (the PC is inaccesible by any user) i have successfully installed theapplication as a windows service. When i start the service, i get thefollowing error

Error 1053: The service did not respond to the start or control request in atimely fashion
1. Is there anyway to extend the timeout period.? I use timed threads toload a serial device driver and this takes time

2. To enable the service to act correctly i assume that the application musthave OnStart and Stop methods. As the Winforms app already inheritsWindows.Forms.Form, how do i also make it inherit
System.ServiceProcess.ServiceBase so I can correctly start and stop (thereare cleanup operations on close)

Thank you for your help in this matter

..Net Framework v 1.1.4322.573
.

Nov 16 '05 #2
So far i have developed the following method

Create your WinApp as normal (look out for further replies from knowledgable
people re: System.ServiceProcess, re my question) you have to then setup a
windows service installer look at the following
http://www.c-sharpcorner.com/Code/20...ceInCSharp.asp to
create the service (I have used this to develop a standalone app that will
install any service)
Use installUtil (look in dotnet framework SDK) to install the service
installer and make sure the imagepath points at your executable -

When you have setup the service make sure that the app can interact with the
windows desktop (right click the service in service manager). So far that is
where i am. The app starts then closes after a timeout - this is where i am
stuck

Hope that helps, if you get further than me, let me know]

Richard

"W AKthar" wrote:
Hi Richard,

This not an anser to your question but more of a help
question.
I too have tried to create a WinForm windows service biut
have not be able to. Can you please tell me how to do
this??

-----Original Message-----
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 the

service, i get the
following error

Error 1053: The service did not respond to the start or

control request in a
timely fashion
1. Is there anyway to extend the timeout period.? I use

timed threads to
load a serial device driver and this takes time

2. To enable the service to act correctly i assume that

the application must
have OnStart and Stop methods. As the Winforms app

already inherits
Windows.Forms.Form, how do i also make it inherit
System.ServiceProcess.ServiceBase so I can correctly

start and stop (there
are cleanup operations on close)

Thank you for your help in this matter

..Net Framework v 1.1.4322.573
.

Nov 16 '05 #3
Hi,

The start process should be a fast one, my advice is to create a thread and
do the lengtly operation there. This is the corect way to implement it
anyway.

Another thing, a win app is VERY DIFFERENT from a windows service, in fact
in a win service you should not use any Windows.Forms.Form classes.

I suggest you to take a look at the how-to of creating a win process.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Richard Steele" <Ri***********@discussions.microsoft.com> wrote in message
news:C1**********************************@microsof t.com...
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 the service, i get the
following error

Error 1053: The service did not respond to the start or control request in
a
timely fashion
1. Is there anyway to extend the timeout period.? I use timed threads to
load a serial device driver and this takes time

2. To enable the service to act correctly i assume that the application
must
have OnStart and Stop methods. As the Winforms app already inherits
Windows.Forms.Form, how do i also make it inherit
System.ServiceProcess.ServiceBase so I can correctly start and stop (there
are cleanup operations on close)

Thank you for your help in this matter

.Net Framework v 1.1.4322.573

Nov 16 '05 #4
Hi,
"Richard Steele" <Ri***********@discussions.microsoft.com> wrote in message
news:21**********************************@microsof t.com...
So far i have developed the following method

Create your WinApp as normal


This is wrong, you should select as the project type Windows service, I
think this is why you are getting the errors you have, a win service is a
COMPLETELY DIFFERENT thing than a win app.

Create a new project with this type and check the code generated, you will
see what I mean

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Nov 16 '05 #5

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:Os**************@tk2msftngp13.phx.gbl...
Hi,

The start process should be a fast one, my advice is to create a thread
and do the lengtly operation there. This is the corect way to implement it
anyway.

Another thing, a win app is VERY DIFFERENT from a windows service, in fact
in a win service you should not use any Windows.Forms.Form classes.

I suggest you to take a look at the how-to of creating a win process.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


You are right, as rule number 1, "Windows Services" should have a user
interface nor should it use UI elements like a MessageBox, that's also the
reason why the "service" project wizard doesn't include the code to
create/initialize a Windows Form. But as always people are in search to find
alternative ways to build "Windows Forms Services" and sooner than later
they get stuck, because of rule 1.

Willy.
Nov 16 '05 #6

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: vinoth | last post by:
Hi, I have created WindowsService Project.In that Project OnStart Method i have written the following Code. In this code the Server is waiting for the connection from client. When the Client...
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...
3
by: =?Utf-8?B?RGFuZGFuIFpoYW5n?= | last post by:
Now I have a web application, a web service and a SQL Server database. The Web application will invoke the web service, the web service invokes the SQL Server stored procedure. I let the web...
7
by: =?Utf-8?B?Sm9obi5ORVQ=?= | last post by:
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...
10
by: archana | last post by:
Hi all, I am having one windows service which is updating to database. On 'Onstop i want to wait till current updation complete. How will i do this? Because if i write some lengthy code on...
1
by: eblackmo | last post by:
I have a test network consisting of four servers running windows 2003 server R2 SP2. I have set up a domain which functioned correctly for about a day and a half until the other servers decided they...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.