如何在IIS Express中启用远程请求?Scott Guthrie写道,这是可能的,但他没有说明如何实现。
当前回答
帮助我的是右键单击“IISExpress”图标,“显示所有应用程序”。然后选择网站,我看到哪个应用程序主机。它使用的配置,纠正进行得很完美。
其他回答
我在win8.1中使用IIS Express和外部请求时遇到一些问题。
我遵循以下步骤调试外部请求:
安装IIS 配置Visual Studio以使用本地IIS (Web项目中的页面属性) 在IIS中创建一个专用的appool来使用我的应用程序 在我的项目中,我使用Oracle客户端,必须是32位(64位不使用Visual Studio),然后我需要在应用程序池中允许32位 配置Windows防火墙以允许端口80中的请求(入站规则)
这是工作!
我记得几个月前在尝试这个工作流时遇到了同样的问题。
这就是为什么我专门为这种场景编写了一个简单的代理实用程序:https://github.com/icflorescu/iisexpress-proxy。
使用IIS Express Proxy,一切都变得非常简单——不需要“netsh http add urlacl url=vaidesg:8080/ user=everyone”,也不需要弄乱你的“applicationhost.config”。
只需在命令提示符中发出以下命令:
Iisexpress-proxy 8080 ~ 3000
然后你可以把你的远程设备指向http://vaidesg:3000。
大多数时候越简单越好。
您可能需要做三个更改。
告诉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”应用程序“/”
如果你正在使用Visual Studio,那么按照以下步骤通过ip地址访问IIS-Express:
Get your host IP-Adress: ipconfig in Windows Command Line GoTo $(SolutionDir)\.vs\config\applicationHost.config Find <site name="WebApplication3" id="2"> <application path="/" applicationPool="Clr4IntegratedAppPool"> <virtualDirectory path="/" physicalPath="C:\Users\user.name\Source\Repos\protoype-one\WebApplication3" /> </application> <bindings> <binding protocol="http" bindingInformation="*:62549:localhost" /> </bindings> </site> Add: <binding protocol="http" bindingInformation="*:62549:192.168.178.108"/> with your IP-Adress Run your Visual Studio with Administrator rights and everything should work See post from Andrii how to configure Firewall: here
帮助我的是右键单击“IISExpress”图标,“显示所有应用程序”。然后选择网站,我看到哪个应用程序主机。它使用的配置,纠正进行得很完美。
推荐文章
- 实体框架核心:在上一个操作完成之前,在此上下文中开始的第二个操作
- 如何为构造函数定制Visual Studio的私有字段生成快捷方式?
- 如何使用JSON确保字符串是有效的JSON。网
- AppSettings从.config文件中获取值
- 通过HttpClient向REST API发布一个空体
- 如何检查IEnumerable是否为空或空?
- 自动化invokerrequired代码模式
- 在c#代码中设置WPF文本框的背景颜色
- 在c#中,什么是单子?
- c#和Java中的泛型有什么不同?和模板在c++ ?
- c#线程安全快速(est)计数器
- 如何将此foreach代码转换为Parallel.ForEach?
- 如何分裂()一个分隔字符串到一个列表<字符串>
- 如何转换列表<字符串>列表<int>?
- c#对象列表,我如何得到一个属性的和