No connection could be made because the target machine actively refused it 127.0.0.1 No connection could be made because the target machine actively refused it 127.0.0.1 asp.net asp.net

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


After six days I find the answer which make me crazy! The answer is disable proxy at web.config file:

<system.net>  <defaultProxy>     <proxy usesystemdefault="False"/>   </defaultProxy></system.net>


The exception message says you're trying to connect to the same host (127.0.0.1), while you're stating that your server is running on a different host. Besides the obvious bugs like having "localhost" in the url, or maybe some you might want to check your DNS settings.


There is a firewall blocking the connection or the process that is hosting the service is not listening on that port. Or it is listening on a different port.