Alex
Alex

Reputation: 2609

IISExpress keeps refusing connections from custom domain

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:

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.

Upvotes: 0

Views: 468

Answers (1)

Jim W
Jim W

Reputation: 5016

You could install our free VS extension called Conveyor (in Tools->Extensions). It will open a new port that will accept connections from other host names.

Eg. it will open port 45455, then you can go to http://mydomain:45455

You won't need the binding changes anymore, but you will need to keep the hosts file change of course. Also you can signup for tunneling if you want to use one of our subdomains to access over the internet.

Upvotes: 1

Related Questions