Android模拟器环回IIS防爆preSS不工作,但与卡西尼工作 [英] Android Emulator loopback to IIS Express does not work, but does work with Cassini

查看:188
本文介绍了Android模拟器环回IIS防爆preSS不工作,但与卡西尼工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的本地机器上张贴从Android应用程序在Android模拟器中运行的数据在IIS下防爆preSS也是我的本地机器上运行运行的Web应用程序。不幸的是,当我发布到10.0.2.2从模拟器我收到找不到主机错误消息。

如果我配置,而不​​是IIS防爆$ P $ Web应用程序下的ASP.NET开发服务器(卡西尼)运行PSS的Andr​​oid应用程序能够发布,没有任何问题。我错过了IIS防爆preSS是$ P $从与Android模拟器环回工作pventing是什么样的配置?


解决方案

授予自己权限绑定到localhost以外的网络适配器和配置IIS前preSS绑定到所有适配器。

然后

IIS防爆preSS将通过10.0.2.2接受来自Android模拟器连接。如果您添加规则,防火墙,你也可以公开的IIS防爆preSS到您的网络,从而降低安全性,而且是非常有用的用于测试物理设备。

步骤的细节:(他们承担的5555的端口号 - 用你的实际端口代替)


  1. 在命令提示符下以管理员身份运行此:

    的netsh的http添加urlacl URL = HTTP:// *:5555 / USER =NT AUTHORITY \\ INTERACTIVE


  2. %USERPROFILE%\\文档\\ IISEx preSS \\设置\\对ApplicationHost.config 的,请用 bindingInformation =您的网站的本地主机绑定*:5555 :*?。其结果应该是这样的:


<网站名称=...ID =...>
        <! - 应用程序设置不再赘述 - >
        <&绑定GT;
            <绑定协议=HTTPbindingInformation =*:5555:*/>
        < /绑定>
    < /网站>

I am attempting to post data from an Android application running in the Android Emulator on my local machine to a web application running under IIS Express also running on my local machine. Unfortunately, when I post to 10.0.2.2 from the emulator I receive a Host Not Found error message.

If I configure the web application to run under ASP.NET Dev Server (Cassini) instead of IIS Express the Android application is able to post with no problems. What configuration am I missing for IIS Express that is preventing it from working with a loopback from the Android emulator?

解决方案

Grant yourself permission to bind to network adapters other than localhost, and configure IIS express to bind to all adapters.

IIS Express will then accept connections from the Android emulator via 10.0.2.2. If you add a rule to the firewall, you can also expose IIS Express to your network, which decreases security but is useful for testing physical devices.

Step details: (they assume a port number of 5555 - use your actual port instead)

  1. Run this from a command prompt as Administrator:

    netsh http add urlacl url=http://*:5555/ user="NT AUTHORITY\INTERACTIVE"

  2. In %USERPROFILE%\Documents\IISExpress\config\applicationhost.config, replace your site's localhost binding with bindingInformation="*:5555:*". The result should look like this:

    <site name="..." id="...">
        <!-- application settings omitted for brevity -->
        <bindings>
            <binding protocol="http" bindingInformation="*:5555:*" />
        </bindings>
    </site>

这篇关于Android模拟器环回IIS防爆preSS不工作,但与卡西尼工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆