我有一个ASP.NET Web服务应用程序,我想在端口80以外的端口上运行。我发现这篇关于绑定的文章:
http://www.iis.net/configreference/system.applicationhost/sites/site/bindings/binding
但我无法弄清楚如何正确实施它。它描述的GUI方法似乎最简单,但第3步说:
- 在操作窗格中,点击绑定...
醇>
如您所见,我不存在该选项(IIS 8.5):
他们还提供此配置示例:
<site name="Contoso" id="2">
<application path="/" applicationPool="Contoso">
<virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot" />
</application>
<bindings>
<binding protocol="http" bindingInformation="192.168.0.1:80:www.contoso.com" />
<binding protocol="https" bindingInformation="*:443:" />
</bindings>
</site>
我假设它在web.config中?当我像这样添加时,我收到Unrecognized configuration section system.applicationHost
的配置错误:
<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings/>
<system.applicationHost>
<sites>
<site name="MyWebService" id="1">
<bindings>
<binding protocol="http" bindingInformation="*:443" />
</bindings>
</site>
</sites>
</system.applicationHost>
<!-- more stuff I didn't mess with beyond here -->
但是当我删除system.applicationHost
标记时,我只会得到一个不同的错误。我做错了什么?
谢谢!
答案 0 :(得分:1)
您可以选择上述任一选项来实现您的目标。