Click here to Skip to main content
15,913,685 members
Home / Discussions / C#
   

C#

 
AnswerRe: Cannot find redistributable .cat file..? [modified] Pin
Roger Wright18-Jun-10 8:27
professionalRoger Wright18-Jun-10 8:27 
QuestionWindows service failed to start. Pin
Anil Veeraghattapu 418-Jun-10 1:14
Anil Veeraghattapu 418-Jun-10 1:14 
AnswerMessage Closed Pin
18-Jun-10 1:16
stancrm18-Jun-10 1:16 
GeneralRe: Windows service failed to start. Pin
Anil Veeraghattapu 418-Jun-10 1:20
Anil Veeraghattapu 418-Jun-10 1:20 
GeneralRe: Windows service failed to start. Pin
Anil Veeraghattapu 418-Jun-10 1:28
Anil Veeraghattapu 418-Jun-10 1:28 
GeneralMessage Closed Pin
18-Jun-10 1:30
stancrm18-Jun-10 1:30 
AnswerRe: Windows service failed to start. Pin
Anil Veeraghattapu 418-Jun-10 2:32
Anil Veeraghattapu 418-Jun-10 2:32 
GeneralRe: Windows service failed to start. Pin
Dave Kreskowiak18-Jun-10 2:06
mveDave Kreskowiak18-Jun-10 2:06 
Anil Veeraghattapu 4 wrote:
i put all the code of the Onstart event


There is your problem.

The general layout of a Service is, in OnStart, you are expected to start a seperate thread that handles your main service code loop, such a listeners or some kind of polling loop, ... This releases OnStart and returns control back to the Service Control Manager.

In OnStop, you shutdown this loop as appropriate and let the thread stop gracefully.

Putting all of your code in OnStart gives you exactly the error message your getting because OnStart never returns control back to the SCM within the default 30 seconds the SCM expects OnStart to return.

A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008
But no longer in 2009...




AnswerRe: Windows service failed to start. Pin
#realJSOP18-Jun-10 1:28
professional#realJSOP18-Jun-10 1:28 
GeneralRe: Windows service failed to start. Pin
Anil Veeraghattapu 418-Jun-10 1:33
Anil Veeraghattapu 418-Jun-10 1:33 
GeneralRe: Windows service failed to start. Pin
#realJSOP18-Jun-10 11:20
professional#realJSOP18-Jun-10 11:20 
AnswerRe: Windows service failed to start. Pin
Gonzalo Cao18-Jun-10 1:43
Gonzalo Cao18-Jun-10 1:43 
GeneralRe: Windows service failed to start. Pin
Anil Veeraghattapu 418-Jun-10 2:35
Anil Veeraghattapu 418-Jun-10 2:35 
AnswerRe: Windows service failed to start. Pin
R. Giskard Reventlov18-Jun-10 2:31
R. Giskard Reventlov18-Jun-10 2:31 
Questionhow to destroy window handle Pin
KaurGurpreet17-Jun-10 22:54
KaurGurpreet17-Jun-10 22:54 
AnswerMessage Closed Pin
17-Jun-10 23:12
stancrm17-Jun-10 23:12 
GeneralRe: how to destroy window handle Pin
KaurGurpreet17-Jun-10 23:21
KaurGurpreet17-Jun-10 23:21 
AnswerRe: how to destroy window handle Pin
Luc Pattyn18-Jun-10 1:22
sitebuilderLuc Pattyn18-Jun-10 1:22 
AnswerRe: how to destroy window handle Pin
Dave Kreskowiak18-Jun-10 2:03
mveDave Kreskowiak18-Jun-10 2:03 
QuestionList all users of computer Pin
Sunil G17-Jun-10 22:53
Sunil G17-Jun-10 22:53 
AnswerMessage Closed Pin
17-Jun-10 23:07
stancrm17-Jun-10 23:07 
GeneralRe: List all users of computer Pin
Sunil G17-Jun-10 23:19
Sunil G17-Jun-10 23:19 
GeneralRe: List all users of computer Pin
ddecoy18-Jun-10 2:14
ddecoy18-Jun-10 2:14 
QuestionHow to create xmpp client using C# Pin
manjeeet17-Jun-10 22:20
manjeeet17-Jun-10 22:20 
Answercross-post Pin
Luc Pattyn18-Jun-10 2:30
sitebuilderLuc Pattyn18-Jun-10 2:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.