如何安装了相同的Windows服务的多个实例多个、实例、安装了、Windows

2023-09-04 02:14:10 作者:一把纸伞碎江南

我创建了一个窗口serives

I created one windows serives

它得到的服务的名称从Web配置文件。

It gets the name of the service from web config file.

我用下面的链接,从webconfig中获得价值。 HTTP://www.$c$cproject.com/KB/dotnet/MultipleInstNetWinService的.aspx

I used the below link for getting value from webconfig. http://www.codeproject.com/KB/dotnet/MultipleInstNetWinService.aspx

安装我的窗口服务,我只是单击该图标并安装 再次,我更改配置文件中的值和rebulid我的应用程序。

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.

如何安装了相同的Windows服务的多个实例?

How to install multiple instance of same windows service?

谢谢, 普加

推荐答案

您需要为您服务的可执行文件复制到一个单独的目录,并使用InstallUtil.exe给它一个不同的服务名称。

You need to copy your service executable to a separate directory and use InstallUtil.exe to give it a different service name.

这听起来像你错过了这个节链接的文章

It sounds like you missed this section in the linked article

在命令提示符下,你需要使用InstallUtil安装这两个   你的服务的实例。关于如何使用InstallUtil指令,   看到安装工具(InstallUtil.exe)。一旦您完成安装   服务实例,你就会有类似的服务控制台   以上,其中的服务实例1 和服务实例2 的是从创建   同样的可执行文件,只是从不同的目录位置安装   用一个不同的服务名称

From a command prompt, you'll need to use InstallUtil to install both instances of your service. For instructions on how to use InstallUtil, see Installer Tool (InstallUtil.exe). Once you're done installing the service instances, you'll have something like the services console above where Service Instance 1 and Service Instance 2 are created from the same executable, only installed from different directory locations with a different service name.