简体   繁体   中英

Can a windows service use a WCF service hosted by another Windows Service?

I created a WCF service and hosted it in a windows service in my machine, with my machine IP in base address. I have another windows service (lets say Service 2) that needs to consume this WCF service. While installing the Service 2, I am getting below error:

在此处输入图像描述

Yes,you can.I tested it and found that it worked,So this is a question about windows service.This error often occurs when you do not stop the service before attempting to uninstall the service or/and some associated processes or handles are suspended, resulting in the inability to uninstall the service.

Solution

1.closing the Services Manager (services.msc or the mmc.exe tool) will solve it.

2.Also check to make sure that no instance of mmc.exe is running in Task Manager.

3.If the above solution doesn't work, you can try to restart your computer.

You can refer to this link, which has many solutions to this problem:

How to solve "The specified service has been marked for deletion" error

I hosted the WCF service on a Windows service and made a class library to consume the hosted WCF service. The DLL was then used in another windows service (Service 2). The problem happened because the App.config of the Service 2 did not have the information that was present in the config of the Dll that consumed the service. After adding the config, this error didnt occur.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM