如何从远程计算机访问Windows 11上的IIS Express站点?
如何从远程计算机访问Windows 11上的IIS Express站点?
我曾在搭载Intel芯片、运行MacOS Monterey的MacBook Pro上,通过Parallel Desktop 15运行Windows 10,按照相关步骤成功实现了远程访问。但在公司搭载M1芯片、运行MacOS Monterey的MacBook Pro上,通过Parallel Desktop 18运行Windows 11时,执行相同操作却无法成功,推测问题出在Windows 11上。
以下是我在Windows 10上成功实现远程访问的步骤,供参考:
1. 将应用绑定到公网IP地址
- 以管理员权限打开Windows命令提示符,输入
ipconfig,记录IPv4地址(示例值:xx.xxx.xx.5) - 打开
/{project folder}/.vs/config/applicationhost.config,在<binding protocol="http" bindingInformation="*:41036:localhost" />行下方,添加一行配置:<binding protocol="http" bindingInformation="*:41036:xx.xxx.xx.5" />
2. 允许传入连接
执行以下命令:
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
完成上述步骤后,我可以在MacOS中通过http://xx.xxx.xx.5:41036/weatherforecast访问该站点。
内容的提问来源于stack exchange,提问作者Tuan van Duong
相关产品推荐
相关产品推荐

