Unable to connect client to service hosted on another computer. Keep get EndpointNotFoundException

Angelos Erilus 1 Reputation point
2021-04-28T21:54:50.327+00:00

My plan is to host a WCF Service on one machine hosted as a Windows Service, and have a instance of the client run on multiple computers that access the service.

I keep getting EndpointNotFoundException, when launching the client from another computer.

When I looked at wireshark the sync message is sent to the service ip port but never acknowledgded. Instead tcp retransmission messages are sent.

I have firewall rules already for the ports, and verified through netstat that the port is opened and listening. Below are my service configurations

service App.config:

<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="tcpConfig">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="ControlService.CCService">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="tcpConfig" contract="ControlService.ICCService">
<identity>
<dns value="mainPC24"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://192.168.1.135:58600/ControlService/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>

client app.config

<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_ICCService">
<security mode="None">
<transport sslProtocols="None" />
</security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://192.168.1.135:58600/ControlService/"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_ICCService"
contract="CS.ICCService" name="NetTcpBinding_ICCService">
<identity>
<dns value="mainPC24" />
</identity>
</endpoint>
</client>
</system.serviceModel>

The setup works great on the same machine but doesnt on a seperate machines. I have spent the last month reading forums and no solution has worked for my situation.

I have the following in my Service class: [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single, UseSynchronizationContext = true)]

I have the following in my Service Interface: [ServiceContract(CallbackContract = typeof(ITCCServiceCallback), SessionMode = SessionMode.Required)]

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,142 questions
{count} votes