How to host 2 WCF services in 1 Windows Service?

前端 未结 4 704
再見小時候
再見小時候 2021-02-04 16:47

I have a WCF application that has two Services that I am trying to host in a single Windows Service using net.tcp. I can run either of the services just fine, but as soon as I t

4条回答
  •  遥遥无期
    2021-02-04 17:17

    If you want one Windows service to start two WCF services, you'll need one ServiceInstaller that has two ServiceHost instances, both of which are started in the (single) OnStart method.

    You might want to follow the pattern for ServiceInstaller that's in the template code when you choose to create a new Windows Service in Visual Studio - in general this is a good place to start.

提交回复
热议问题