Why does SvcUtil create a Channel interface that derives from IClientChannel
-
24-09-2019 - |
Question
When you create code from a WSDL file using SvcUtil.exe, among the many types created is an interface that derives from both the service interface and IClientChannel.
If, for example, the created service interface is called IMyService, it also creates this interface:
public interface IMyServiceChannel :
IMyService, System.ServiceModel.IClientChannel
Why does it define this interface? As far as I can see, it's not referenced from anywhere in the auto-generated code.
Solution
[UPDATE]
Found a link on MSDN (scroll to the very bottom). Nothing implements it, but you can use it when using ChannelFactory directly.
It's there so that users can have intelisense for both your service interface and WCF infrastructure in one place.
I remember someone from MS talking about it on a podcast or some blog...
OTHER TIPS
Have you tried wsdl.exe? "svcutil /?" will show you the supported values for /tcv (target clr version).