Click here to Skip to main content
15,882,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, I am doing a chat in C# and I got this error

C#
System.ServiceModel.EndpointNotFoundException: Could not connect to http://localhost:9000/MyService. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:9000

Can anyone help ?
Thank you.
Here is the config file of server :
C#
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    
    <system.serviceModel>
        <services>
            <service name="ChattingServer.ChattingService">
                <endpoint address="net.tcp://localhost:9000/MyService"
                    binding="netTcpBinding" bindingConfiguration="" name="ChattingServiceEndPoint"
                    contract="ChattingInterfaces.IChattingService" />
            </service>
        </services>
    </system.serviceModel>
</configuration>

And here is for the client side:

C#
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
        <client>
            <endpoint address="net.tcp://localhost:9000/MyService"
                binding="netTcpBinding" bindingConfiguration="" contract="ChattingInterfaces.IChattingService"
                name="ChattingServiceEndPoint" kind="" endpointConfiguration="" />
        </client>
    </system.serviceModel>
</configuration>


What I have tried:

I tried by activating the net.tcpListenerAdapter(Start->Service) but nothing happened.
Posted
Comments
Suvendu Shekhar Giri 4-Aug-16 11:47am    
Try disabling firewall, if it helps.
TatsuSheva 4-Aug-16 11:49am    
did it but nothing happened
Richard Deeming 4-Aug-16 12:01pm    
Are the client and server running on the same computer?
Have you started the server before starting the client?
TatsuSheva 4-Aug-16 12:05pm    
yes I am implementing in my computer. The server start before the client.
Foothill 4-Aug-16 17:11pm    
I don't know if it will help, but here's something similar form SO
http://stackoverflow.com/questions/38772393/i-am-getting-a-tcp-error-code-10061

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900