IIS 8.5 - 更改我的 Web 服务应用程序运行的端口

IIS 8.5 - Change the port my web service application runs on

我有一个 ASP.NET Web 服务应用程序,我想 运行 在端口 80 以外的端口上。我找到了这篇关于绑定的文章:

http://www.iis.net/configreference/system.applicationhost/sites/site/bindings/binding

但我不知道如何正确实施它。它描述的 GUI 方法似乎是最简单的,但第 3 步说:

  1. In the Actions pane, click Bindings...

如您所见,该选项对我来说不存在 (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 标签时,我得到了一个不同的错误。我做错了什么?

谢谢!

  1. 当左窗格中的活动节点是您的 Web 服务而不是托管您的应用程序的网站时,可以肯定的是截取了有问题的屏幕截图。您可以在网站级别而不是 Web 应用程序级别修改绑定。左窗格中的第一个 select 网站,您的 Web 服务位于该网站下,您应该能够修改绑定。但请注意,修改后的绑定将适用于该网站下托管的所有 Web 应用程序。
  2. 您可以修改配置文件中的绑定,但这些设置驻留在位于 C:\Windows\System32\inetsrv\config.
  3. 的 applicationhost.config 文件中

您可以选择以上任一选项来实现您想要的效果。