locked
IISExpress Custom Domains RRS feed

  • Question

  • User1275757661 posted

    I've been (successfully) running a couple of ASP.NET (.NET Framework 4.6.2, WebForms) websites through Visual Studio 2017 / IISExpress using custom domains. I installed Visual Studio 2019 (Community) the other day, and all of a sudden the custom domains have stopped working on all projects in both Visual Studio 2017 and 2019! The system-tray for IIS Express still continues to show that the binding is accepted:

    enter image description here

    However, when attempting to browse to that URL, Chrome gives me a "ERR_CONNECTION_REFUSED" error:

    enter image description here

    Just to be clear, the steps are taken on each project are as follows:

    1. Modify the applicationhost.config file in the web project's .vs folder to include:

    <binding protocol="http" bindingInformation="*:80:agentdesktop.local" />

    1. In an elevated command prompt, execute:

    netsh http add urlacl url=http://agentdesktop.local:80/ user=everyone

    1. Add to the hosts file:

    127.0.0.1 agentdesktop.local

    I've deleted the .vs directory, removed the urlacl entry, removed the IISExpress directory in the Documents folder. Performed all actions outlined above as had been done previously, and still I cannot get it to accept the connection!

    If I ping agentdesktop.local then I get a valid response from 127.0.0.1, and the fact it's appearing in the IIS Express system tray, makes me think that something in between is intercepting and blocking. I've installed Fiddler and watched an attempted connection on the custom domain, and the response is:

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

    Does anybody else have any ideas as to how I could get this back working again, or what might have gone wrong!?

    Tuesday, February 11, 2020 9:02 AM

All replies

  • User-719153870 posted

    Hi chrisbarton126,

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

    If I ping agentdesktop.local then I get a valid response from 127.0.0.1

    Most likely the 80 port has been occupied, run netstat -aon in your cmd or powershell to check if it's available.

    Best Regard,

    Yang Shen

    Wednesday, February 12, 2020 6:42 AM
  • User1275757661 posted

    Hi, thanks for the response. I've just run that command, and there is an entry for port 80 but the underlying PID is just "System":

    enter image description here

    Any thoughts?

    Thanks,

    Chris.

    Wednesday, February 12, 2020 8:54 AM