【发布时间】:2018-05-14 09:19:09
【问题描述】:
我正在本地运行一个 WebAPI 项目,我想从连接在同一网络上的移动设备访问该项目。
我已经尝试了here 的所有步骤(tower 是我的主机名),但它不起作用:
There are three changes you might need to make.
Tell IIS Express itself to bind to all ip addresses and hostnames. In your .config file. Typically:
VS 2015: $(solutionDir)\.vs\config\applicationhost.config
Find your site's binding element, and add
<binding protocol="http" bindingInformation="*:8080:tower" />
Setup the bit of Windows called 'http.sys'. As an administrator, run the command:
netsh http add urlacl url=http://tower:8080/ user=everyone
Allow IIS Express through Windows firewall.
Start / Windows Firewall with Advanced Security / Inbound Rules / New Rule...
Program %ProgramFiles%\IIS Express\iisexpress.exe
OR Port 8080 TCP
本地一切正常:
但是在移动设备上 - 我收到一个错误:
tower's server DNS address could not be found.
ERR_NAME_NOT_RESOLVED
有人知道为什么会发生这种情况吗?我错过了一些明显的事情吗?
【问题讨论】:
-
这与您的 IIS 设置无关。无论您的移动设备使用哪个DNS服务器,它都无法解析
tower。 -
我需要在路由器上添加映射或类似的东西吗?
-
可能,但鉴于这与编程无关,您真的应该在 serverfault.com
标签: asp.net iis asp.net-web-api iis-express