如何在IIS Express中启用远程请求?Scott Guthrie写道,这是可能的,但他没有说明如何实现。


当前回答

我在win8.1中使用IIS Express和外部请求时遇到一些问题。

我遵循以下步骤调试外部请求:

安装IIS 配置Visual Studio以使用本地IIS (Web项目中的页面属性) 在IIS中创建一个专用的appool来使用我的应用程序 在我的项目中,我使用Oracle客户端,必须是32位(64位不使用Visual Studio),然后我需要在应用程序池中允许32位 配置Windows防火墙以允许端口80中的请求(入站规则)

这是工作!

其他回答

如果你尝试过Panic上校的答案,但在Visual Studio中不起作用,试试这个:

在IIS Express配置中附加另一个<binding />

<bindings>
    <binding protocol="http" bindingInformation="*:8080:localhost" />
    <binding protocol="http" bindingInformation="*:8080:hostname" />
</bindings>

最后,你必须以管理员的身份运行Visual Studio

顺便说一句:

netsh http add urlacl url=http://vaidesg:8080/ user=everyone

这只适用于英文版的Windows。如果你正在使用本地化版本,你必须用其他东西替换“everyone”,例如:

在使用荷兰语版本时是“Iedereen” 使用德语版本时使用“Jeder” 当使用匈牙利语版本时,“Mindenki”

否则你会得到一个错误(创建SDDL失败,错误:1332)

我通过在Visual Studio Professional 2015中安装“输送机by Keyoti”解决了这个问题。输送机生成一个远程地址(您的IP),端口(45455)支持外部请求。例子:

输送机允许您从网络上的外部平板电脑和手机或Android模拟器测试web应用程序(没有http://10.0.2.2:<hostport>)

操作步骤如下:

https://marketplace.visualstudio.com/items?itemName=vs-publisher-1448185.ConveyorbyKeyoti

如果你从管理员运行Visual Studio,你可以添加

<装订协议=“http”bindingInformation=“8080:*”/>

or

<装订协议=“https”binps条=“*:8443:*”/>

into

%userprofile%\My Documents\IISExpress\config\applicationhost.config

您可能需要做三个更改。

告诉IIS Express本身绑定到所有ip地址和主机名。在你的。config文件中。通常: VS 2015: $ (solutionDir) \ .vs \ config \ applicationhost.config < VS 2015: %userprofile%\My Documents\IISExpress\config\applicationhost.config

找到站点的绑定元素,然后添加

    <binding protocol="http" bindingInformation="*:8080:*" />

设置Windows中名为“http.sys”的部分。以管理员身份执行如下命令:

    netsh http add urlacl url=http://*:8080/ user=everyone

每个人都是一个windows组。对于有空格的组使用双引号,如“Tout le monde”。

允许IIS Express通过Windows防火墙。 启动/ Windows防火墙高级安全/入站规则/新规则… 程序%ProgramFiles%\IIS Express\iisexpress.exe 或端口8080 TCP

现在,当您启动iisexpress.exe时,您应该看到如下消息

成功注册网址“http://*:8080/”网站“hello world”应用程序“/”