Search code examples
wcfwcf-security

WCF No connection could be made because the target machine actively refused


I just implemented a simple WCF server using net.tcp.

First, I use 127.0.0.1 as server address and client able to connect the WCF service.

Everything is Ok. But when I try to use the internal IP 192.x.x.x I get an error:

No connection could be made because the target machine actively refused it

Any idea what may cause this?

Best Wishes

PS: I disabled auth on WCF. Even turn off firewall all...Not worked...


Solution

  • Do you use 192.x.x.x on both client and server? I remember seeing an issue a while back in which for TCP the client and server names needed to match (something related to one of the message properties), so if you define the service with "localhost" and the client with <machine name> there would be a problem.