Sunday, May 1, 2011

Local ASP.Net connection issues

I have been trying to set-up my recently reimaged workstation for working with one of our ASP.Net applications that consists of a ASP.Net website and some C# Web Services. I can successfully start debug instances of each the services and web site. However as soon as the site attempts to connect to and use one of the web services I get the following exception.

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

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it

So it looks like my PC is refusing the connection to itself. My first thought was to to check the windows firewall is disabled and it is disabled (the service is not running). I do not think IT has any other firewall software running on this PC, so I am a bit stumped as to what else could be causing the connection to be refused.

From stackoverflow
  • Silly question, but do you actually have IIS installed on your machine? When you run debug instances of your applications, it's running outside of IIS. If you're running debug instances of both your site and your service, your service probably isn't running on port 80.

    Double check your IIS installation...and then set up your service running on port 80 properly.

    Danielb : D'oh! I had forgotten I needed to install IIS! In my defense its been a good year or so since I last had to set-up a PC for web development. Even still forgetting to install IIS is embarrassing!
  • you don't need IIS since VS provides with its own web platform integrated debugger. IIS IS NOT THE PROBLEM WHEN YOU SEE "connection actively refused"


Post a Comment