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

Windows Service - Error 1053

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

"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 discussion thread is closed

Replies have been disabled for this discussion.