current OperationContext is null in WCF Windows Service

后端 未结 5 1618
感情败类
感情败类 2020-12-19 03:20

I am trying to set up a Publish/Subscribe system using WCF and where the WCF server is in a Windows service. The binding is net.TCP. The service is providing a \"Subscribe

5条回答
  •  醉酒成梦
    2020-12-19 04:20

    As discussed in the comments, if you directly create an instance of the service type - as opposed to a WCF proxy/clientchannel - and then you call a method on it, there is no OperationContext. WCF provides an OperationContext instance when your operation is running within a service.

提交回复
热议问题