current OperationContext is null in WCF Windows Service

后端 未结 5 1616
感情败类
感情败类 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

    In my case it was me being stupid...

    I tried to set

     callback = OperationContext.Current.GetCallbackChannel();
    

    In the CALLBACK function, instead of the server side funciton... When in callback function - obviously there's no current context.

提交回复
热议问题