通过本地网络访问IISExpress上运行的WebAPI

时间:2017-11-30 12:31:11

标签: asp.net iis asp.net-web-api iis-express

我在本地运行一个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

当地一切正常:

enter image description here

但是在手机上 - 我收到了一个错误:

tower's server DNS address could not be found.

ERR_NAME_NOT_RESOLVED

有人知道为什么会这样吗 - 我错过了一些明显的东西吗?

1 个答案:

答案 0 :(得分:0)

这很可能意味着&#34;塔&#34;没有DNS对应,因此您需要使用IP地址或添加正确的DNS条目。