Subscribe to events within a WCF service

后端 未结 3 1864
广开言路
广开言路 2020-12-30 08:55

I have a need to do some real-time reporting on the functionality of a WCF service. The service is self-hosted in a windows app, and my requirement is to report \"live\" to

3条回答
  •  无人及你
    2020-12-30 09:13

    The service variable is an instance of ServiceHost not your service implementation. Try something like:

    MyService myService = new MyService();
    myService.outputMessage += new MyService.MessageEventHandler(frm2_outputMessage);
    host = new ServiceHost(myService);
    

提交回复
热议问题