WCF Multiple Apps using NetNamedPipe

前端 未结 2 1660
时光取名叫无心
时光取名叫无心 2021-02-06 04:12

I am trying to run multiple WCF Service hosting apps on the same Machine.

I want to run multiple Applications - not multiple services in one application

2条回答
  •  佛祖请我去吃肉
    2021-02-06 04:58

    If you need to create service hosts for different service contracts as show here:

    ...    
    host1 = new SeviceHost(typeof(MyClass1, ...);
    host2 = new ServiceHost(typeof(MyClass2, ...);
    ...
    

    then you do need to use different base addresses for each new ServiceHost as Mathew's answer suggests. If all of your service hosts are for the same typeof(MyClass1) then you may just need to create multiple endpoints for that same service. Each endpoint could be for a different interface (i.e. ISomeInterface1, ISomeInterface2, ...) in that service.

提交回复
热议问题