简体   繁体   English

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

[英]Access WebAPI running on IISExpress over local network

I'm running a WebAPI project locally which I would like to access from a mobile device connected on the same network. 我正在本地运行一个WebAPI项目,我想从连接在同一网络上的移动设备进行访问。

I have tried all the steps here (where tower is my hostame) but it's not working: 我已经尝试了所有的步骤, 在这里 (其中tower是我hostame),但它不工作:

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

Locally everything is working fine: 在本地,一切工作正常:

在此处输入图片说明

However on mobile - I am getting an error: 但是在移动设备上-我收到一个错误消息:

tower's server DNS address could not be found.

ERR_NAME_NOT_RESOLVED

Does anybody know why this might be happening - have I missed something obvious? 有谁知道为什么会这样-我错过了明显的事情吗?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MS SQL连接通过本地网络故障 - MS SQL connection fails over local network IISExpress 10不会通过HTTPS返回原因 - IISExpress 10 will not return reasonphrase over HTTPS iisExpress本地httpruntime.cache始终为null - iisExpress local httpruntime.cache always null 在IISExpress和ASP.NET 5中的webapi中设置基本路径 - set base path in IISExpress and webapi in ASP.NET 5 通过本地网络从Web应用程序访问架构时出错 - Error accessing Schema from web app over over local network 是否可以将ANTS Performance Profiler附加到已经运行的IISExpress进程上? - Is it possible to attached an ANTS Performance Profiler to an already running IISExpress process? 使用Visual Studio在IISExpress上运行网站时出现错误500.21 - Error 500.21 when running site on IISExpress using visual studio IISExpress 找不到使用 Visual Studio 2013 运行本地主机的 ssl 页面 - IISExpress cannot find ssl page running localhost with Visual Studio 2013 asp.net webapi application_start事件触发多次(Visual Studio + iisexpress) - asp.net webapi application_start event firing more than once (Visual studio + iisexpress) 无法访问本地网络中的asp.net网站 - Unable to access an asp.net website in the local network
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM