winservice never finishes start

  • Thread starter Thread starter cs
  • Start date Start date
C

cs

I have a windows service that on the start method it launches a BackGround
thread, and I am not certain if this is the issue. My problem is that my
service never seems to finish starting, the little dialog that says starting
service never goes away and the bar never fills up all the way.
My thread of course must stay alive until the service is stopped.
 
cs said:
I have a windows service that on the start method it launches a BackGround
thread, and I am not certain if this is the issue. My problem is that my
service never seems to finish starting, the little dialog that says starting
service never goes away and the bar never fills up all the way.
My thread of course must stay alive until the service is stopped.

My service starts a thread and then the thread runs, and I exit from
the OnStart function.

That seems to solve the problem, you have to eventually return from
the OnStart else the windows monitoring program won't know that your
service has started up properly.
 
I am a moron, after readng your message I went trhough my code and I had
called Start() on my class rather tghan on the thread (I should have never
named my method start) so I thought the thread was running instead my class
was running but not on its own thread.
 
Back
Top