question

KwebenaAcquah-9104 avatar image
0 Votes"
KwebenaAcquah-9104 asked LanHuang-MSFT answered

System.ServiceModel.EndpointNotFoundException

i am having a connection problem with my server.
![![198008-capture.png][1]][1]



MY CODE CONFIGURATION FOR SERVICE (SERVER SIDE)
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
<system.serviceModel>
<services>
<service name="ChattingServer.ChattingService">
<endpoint address="net.tcp://localhost:8000/ChatService" binding="netTcpBinding"
bindingConfiguration="" name="Chat Service EndPoint" contract="ChattingServer.IChattingService" />
</service>
</services>
</system.serviceModel>
</configuration>


MY CODE CONFIGURATION (CLIENT SIDE)

  </startup>
   <system.net>
     <defaultProxy>
       <proxy usesystemdefault="False"/>
     </defaultProxy>
   </system.net>
     <system.serviceModel>
         <client>
             <endpoint address="net.tcp://localhost:8000/ChatService" binding="netTcpBinding"
                 bindingConfiguration="" contract="ChattingInterfaces.IChattingService"
                 name="ChatServiceEndPoint" kind="" endpointConfiguration="" />
         </client>
     </system.serviceModel>

please some one; i know some one her can salvage me her on how to do the right thing; i can't log into the server, please any help will be highly appreciated. thanks

dotnet-csharpwindows-wcf
capture.png (26.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LanHuang-MSFT avatar image
0 Votes"
LanHuang-MSFT answered

Hi @KwebenaAcquah-9104,
By default, Windows does not enable port sharing.
I recommend you to check that it's enabled correctly as well as check your IIS web application to make sure the enabled protocols include net.tcp.
You can try adding portSharingEnabled="true" to the binding:

 <system.serviceModel>
   <bindings>
     <netTcpBinding name="portSharingBinding" 
                    portSharingEnabled="true" />
   <services>
     <service name="MyService">
         <endpoint address="net.tcp://localhost/MyService"
                   binding="netTcpBinding"
                   contract="IMyService"
                   bindingConfiguration="portSharingBinding" />
     </service>
   </services>
 </system.serviceModel>

Your code does not provide binding information, maybe you can refer to the documentation for how to write it.
Default NetTcpBinding
Net.TCP Port Sharing
Configuring WCF Services Using NetTcpBinding
Best regards,
Lan Huang


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.