2

How can I install same windows service in different Service name as it has to point to a different database on the same machine.

Is there a way I can do without having to rebuild the project and change the name in Service installer?

Thanks in advance

acadia
  • 2,579
  • 17
  • 53
  • 72

1 Answers1

1

The service name is a string. You can pass it as a parameter to the installer and install the same service multiple times using the parameterized service name.

Here's an abstract base class we use for service that includes a code based installer. You can adapt this to parameterized service name easily.

Converting a c# commandline app to a Windows service

Community
  • 1
  • 1
Samuel Neff
  • 70,536
  • 16
  • 132
  • 177