0

I have a Windows service that create more than one instance of ServiceHost...

I want to be able to manage those ServiceHosts through an external winforms admin tool, so I can open and close each of the ServiceHost from a UI.

What are my options (apart from wrapping each ServiceHost with process)?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
liron
  • 375
  • 2
  • 12

2 Answers2

0

You can register one service multiple times with different start parameter and name. Such configuration could be more robust.

sc.exe create Service_1 binPath= "C:\bin\myserv.exe -run=serviceFirst" DisplayName = "Server 1"

sc.exe create Service_2 binPath= "C:\bin\myserv.exe -run=serviceSecond" DisplayName = "Server 2"

Radik
  • 2,715
  • 1
  • 19
  • 24
0

I would expose another (WCF) service from your (Windows) service, exposing operations to manipulate the service hosts in that process.

JohnC
  • 844
  • 4
  • 10