我知道类似的问题已被问了很多次,但我仍然无法正常工作。我希望能够从我的Visual Studio Android模拟器访问我的主机上的IIS Express。我在我的.VS以下绑定\设置\ applicationHost.config文件为我的网站:从Android模拟器IIS快速访问
<binding protocol="http" bindingInformation="*:7265:MyComp" />
<binding protocol="https" bindingInformation="*:44300:MyComp" />
<binding protocol="http" bindingInformation="*:7265:10.0.2.2" />
<binding protocol="https" bindingInformation="*:44300:10.0.2.2" />
<binding protocol="http" bindingInformation="*:7265:localhost" />
<binding protocol="https" bindingInformation="*:44300:localhost" />
当我运行我的主机上的网站,在运行的应用程序列表中,我看到MyComp的绑定和localhost列出,但不是10.0.2.2的。在我的主机上,我可以使用MyComp或localhost进行连接而没有问题。
在模拟器中,我可以使用http://10.0.2.2连接到我的主机上的IIS 7.5(不是快速),没有问题。在我的模拟器中,我不能做的是连接到http://10.0.2.2:7265或https://10.0.2.2:44300这是IIS Express中运行的站点。我收到HTTP 400错误“请求主机名无效。”。我确定这是因为我没有正确设置IIS绑定,但没有任何我尝试工作。有任何想法吗?
谢谢!
你尝试您的计算机名称,而不是IP的。 –
我确实尝试过,但是我得到的主机名未找到DNS错误。我是Android开发新手,但在印象中,您必须使用几个特定的IP中的一个来连接主机.... – NorthFork