How to access an IIS Express site on Windows 11 from a remote computer?
I’m able to make it works on Windows 10 (via Parallel Desktop 15 on my MacBook Pro intel chip with MacOS Monterey) by following this article Accessing an IIS Express site from a remote computer.
But it doesn’t work when I did the same thing on Windows 11 (via Parallel Desktop 18 on my company MacBook Pro M1 chip with MacOS Monterey). So I guess Windows 11 causes the issue.
FYI, following are the steps I used to make it works on Windows 10:
- Bind the app to your public IP Address.
- Open Command Prompt in Windows with Admin right. -> Type
ipconfig
. -> Noted the value of IPv4 Address. Assuming its IPv4 Address isxx.xxx.xx.5
. - Open the
/{project folder}/.vs/config/applicationhost.config
. -> At line<binding protocol="http" bindingInformation="*:41036:localhost" />
, add another line<binding protocol="http" bindingInformation="*:41036:xx.xxx.xx.5" />
.
- Allow incoming connections.
Run the following cmds:
netsh http add urlacl url=http://xx.xxx.xx.5:41036/ user=everyone
netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=41036 profile=private remoteip=localsubnet action=allow
Now I can access the site in MacOS using http://xx.xxx.xx.5:41036/weatherforecast
.
2
Answers
I’ve used IIS Express Proxy as a bit of a hack to access services hosted on IIS Express from VMs before (in Xamarin app development specifically). However, as has been pointed out in the comments, your best option may just be use to use IIS proper.
Try using the Conveyor it’s a free(mium) extension for Visual Studio, you can get it from the extensions menu.
It allows access from devices on your LAN or over the internet through tunneling.