I'm attempting to test a website I have running in a local IISExpress instance with some other machines / devices on my local network. I am running Win7 Pro.
When I first attempt to browse to my machine from another machine on my local network segment, I get a 400 error: Hostname is invalid.
I understand that I need to grant remote access to the ACL with a command on the elevated command prompt like:
netsh http add urlacl url=http://mymachinename:50333/ user=everyone
Now I get a 503 service is unavailable error.
Windows Firewall is currently shut off, and I am able to browse my local IISExpress instance with the address http://localhost:50333
What is the final piece to this configuration puzzle?
None of the answers above worked for me.
I have had two entries in netsh for the same service
netsh http show urlacl
One using a strong wildcard, the other one using a weak wildcard.
Removing the one with the weak wildcard did the job.
More about the strong and weak wildcard in the context of netsh
https://docs.microsoft.com/en-gb/windows/desktop/Http/urlprefix-strings
There was only 1 thing that worked for me.
using
*:portnumber:*
was no good. Yes, after doing that and making sure the Windows Firewall was open, I could connect to the port, but I still got the "503" error.I tested a few things locally, and discovered that only http://localhost worked. Using the real IP address (not 127.0.0.1, but, for instance, 192.168.1.50), still returned a 503 even on the local machine. I tried using the real host name in the bindings, but IIS Express refused to start. This may actually have something to do with how the host name was being resolved. I didn't explore that further.
Finally, I ended up using this configuration:
In that way, I was able to connect from a remote machine using
http://192.168.1.50:53351
.Found the problem had to do with a bad urlacl mapping. To figure this out:
and look for things like
http://+:80/
or the port you are binding to.Then use
This fixed the problem for me.
What helped me, was right clicking the 'IISExpress' icon, 'Show All applications'. Then selecting the website and I saw which aplicationhost.config it uses, and the the correction went perfectly.
The problem is updating the applicationhost.config file inside the web folder instead of the solution's. The solution config file is the one to change
After solution of @vikomall don't forget to start VS as adminisrator. This fix it for me.