In my project I have two services Service1 and Service2 (i.e.service contracts).I want these two to be self hosted using console.For this I am using service named "myservice" and implementing both interfaces i.e. IService1 and IService2 like
public class myservice : IService1,IService2
...
....
ServiceHost serviceHost = new ServiceHost(typeof(myservice));
serviceHost.Open();
Endpoints used :
<service behaviorConfiguration="myBehavior" name="myservice">
<endpoint address="sa1" binding="netTcpBinding" contract="IService1"/>
<endpoint address="sa2" binding="netTcpBinding" contract="IService2"/>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8001/" />
</baseAddresses>
</host>
</service>
I want these two be seperate service i.e. service named Service1 and Service2 (instead of myservice) with tcp binding and self hosting.Any code/help/suggestions appreciated.