Alex Rivera | Logout

TopShelf install multiple of the same service on the same machine

Asked 2012-08-02T00:15:26.410
16

I am trying to create windows service using TopShelf. Everything works fine with one instance of the service. However, when I copy the whole service folder to a different location and then run the installation at the location it just hangs on "startup".

I assign the servicename, description, displayaname based on the value in a config files so there is no naming conflict.

Edit
Report

1 Answer

32

It's the service's instancename that you need to differentiate.

From the documentation:

service.exe [verb] [-option:value] [-switch]

install Installs the service

-instance An instance name if registering the service multiple times

So you could use:

service.exe install -instance:FirstInstanceOfMyService

service.exe install -instance:SecondInstanceOfMyService
answered 2012-10-16T08:37:54.553

Your Answer