Tried both Visual Studio 2015 and 2017 with the latest updates, different web apps (.NET Framework and .NET Core based). IISExpress is 10.0, Windows 10 Pro.
When I run a web app like http://localhost:49217, it works. If it's http://mydomain:49217, I get "mydomain refused to connect". At the same time, if I do "ping mydomain", it's successful.
I did:
- "mydomain 127.0.0.1:" in hosts file
- <binding protocol="http" bindingInformation="*:49217:mydomain" /> in applicationhost.config (both replacing localhost entry and keeping both localhost and mydomain)
- made sure that this is the actual applicationhost.config (as there are many locations of them in different Visual Studio versions). For instance, when I change settings directly in Visual Studio, I see that this file gets updated.
- "netsh http add urlacl url=http://mydomain:49217/ user=everyone" under Admin privileges
I tried to run Visual Studio as Admin and also running IISExpress directly (also as Admin):
C:\WINDOWS\system32>"c:\Program Files\IIS Express\iisexpress.exe" /config:"c:\solution_path\.vs\config\applicationhost.config" /site:"solution" Starting IIS Express ... Successfully registered URL "http://localhost:49217/" for site "solution" application "/" Successfully registered URL "http://mydomain:49217/" for site "solution" application "/" Successfully registered URL "http://*:49216/" for site "solution" application "/" Registration completed for site "solution"
I then see incoming connections when it's localhost but not mydomain.
I tried to turn off Windows Defender Firewall for Private and Public networks, to no avail.
What else can I do?
EDIT: I now tried to run one of web apps (.NET Core one) under Kestrel and this worked from the start, I can access http://mydomain:49217 just fine. It's only IISExpress which isn't working, and I have to to use IISExpress, Kestrel is not an option for me.