Windows Service idiot

G

Greg

I have two classes (thus, two services) in one Windows Service
executable. Each properly inherits from System.Process.ServiceBase,
and I have a ServiceInstaller for each service, and one
ServiceProcessInstaller for the entire executable, per the
documentation.

I can compile, and one service starts fine (the original one), but I
can't start the service I just added, and I get this error: "Could not
start the MyService service on Local Computer. Error 1083: The
executable program that this service is configured to run in does not
implement the service."

Huh?! I even copied the code from the first service to ensure it
wasn't a problem with the timer, etc.
Any clues? Thanks in advance for any help.
 
G

Greg

Greg said:
I have two classes (thus, two services) in one Windows Service
executable. Each properly inherits from System.Process.ServiceBase,
and I have a ServiceInstaller for each service, and one
ServiceProcessInstaller for the entire executable, per the
documentation.

I can compile, and one service starts fine (the original one), but I
can't start the service I just added, and I get this error: "Could not
start the MyService service on Local Computer. Error 1083: The
executable program that this service is configured to run in does not
implement the service."

Huh?! I even copied the code from the first service to ensure it
wasn't a problem with the timer, etc.
Any clues? Thanks in advance for any help.


For those keeping score, I found a solution:

In the Main sub of the first service class file (e.g. Service1.vb),
edit the auto-generated code as such:

ServicesToRun = New System.ServiceProcess.ServiceBase() {New Service1,
New Service2}

That does it! There's even some auto-generated comments that allude to
this. Now, each service appears in the services console and can be
started/stopped, etc. independently of one another.
 

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