I created one windows serives
It gets the name of the service from web config file.
I used the below link for getting value from webconfig. http://www.codeproject.com/KB/dotnet/MultipleInstNetWinService.aspx
for installing my windows service,i just click the icon and install again, i change the value in config file and rebulid my application.
again i try to install, it shows error like the specified service already exist.
How to install multiple instance of same windows service?
Thanks, Pooja
Using SC.exe In order to add additional instance of a service to the Windows Service dialog box, each service must have a unique name. In order to achieve this you will need to use the Windows SC utility. The SC utility communicates with the Service Controller and installed services.
Answer. No, you should not have 2 services with the same name. It is mentioned in the Service Configuration Guide that service names should be unique. It it may be possible to create 2 services with the same name, but this can lead to problems in the future and is not a supported configuration.
You can use the same .exe for multiple entries in the "Services" table, as long as the "Service Name" in the list is unique.
I needed to do this for a quick demo of a service running with different parameters.
I copied the directory containing the service exe and then used the sc create
command to setup the second service.
sc create "[NewServiceName]" binPath="[PathToCopiedServiceDirectory]"
How to create a windows service using the Sc.exe command
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With