Multiple services, separate service installers, starting only one in services panel, but all service

S

sdstraub

I have created 5 services in my project, in the 1st service I set
servicestorun = array of all 5 services, I have a project installer
with 5 service installers, one for each service. I have code so that
whenever any service starts, stops or timers elapse a log entry is
created. When I install my project, and start the 1st service in the
services console, it shows that the service started and I have the
corresponding log entry confirming it has started. This is where I am
confused. All services start elapsing and are acting as though they
are running, even though only the 1st shows it is running in the
services console. I see log entries for each service elapsing, but
only the 1st services has run it's onstart event. Of course I don't
want all services to run when I only start the one. And how come, when
obviously all services are running because the timer_elapsed event
creates log entries as coded, they never ran their onstart events? And
how come they are running in the first place? And how come they don't
show as running in the services console??? Arghhh...

Please help.
 
S

sdstraub

Ok so I had some code that started the services in the group that
weren't running. But how come this isn't reflected in the services
console?

colResult = ul.CheckJobStatus()
ServicesNotRun = colResult(1)
ServicesRunning = colResult(2)

Dim Controller As System.ServiceProcess.ServiceController

For Each strServiceName In ServicesNotRun
Controller = New
System.ServiceProcess.ServiceController(strServiceName)

If Controller.Status = ServiceControllerStatus.Stopped Then
Controller.Start()
End If
Next

For Each strServiceName In ServicesRunning
Controller = New
System.ServiceProcess.ServiceController(strServiceName)

Controller.Stop()
Controller.WaitForStatus(ServiceControllerStatus.Stopped)
Controller.Start()
Next
 
S

sdstraub

Confused....

This code is not the source of my problem...why are these services
running when only one is started? Any help is appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top