【问题标题】:Do not include https endpoints if IIS server does not support them如果 IIS 服务器不支持 https 端点,则不要包含它们
【发布时间】:2012-02-10 08:05:19
【问题描述】:

如何在安装过程中评论配置文件的元素? IE。我将 WCF 服务安装到 IIS。如果 IIS 没有 https 协议绑定,我需要在 Web.config 中注释 https 端点。 否则不要评论这个端点。

  <service name="MyServer.MyDataAccessRESTService" behaviorConfiguration="MyServer.MyDataAccessRESTServiceBehavior">
    <endpoint binding="webHttpBinding" contract="MyServer.IMyDataAccessRESTService" 
              bindingConfiguration="webHttpBinding0" behaviorConfiguration="MyDataAccessRESTServiceBehavior" 
              address="http://localhost/svc2Web/svc2rest.svc"></endpoint>
    <endpoint binding="webHttpBinding" contract="MyServer.IMyDataAccessRESTService"
              bindingConfiguration="webHttpBinding1" behaviorConfiguration="MyDataAccessRESTServiceBehavior"
              address="https://localhost/svc2Web/svc2rest.svc"></endpoint>
  </service>

【问题讨论】:

    标签: wix installation config xml


    【解决方案1】:

    我会反过来做。让 web.config 的默认版本省略 HTTPS 端点。如果 IIS 中启用了 HTTPS,请使用 XmlConfig 功能向 web.config 添加一个新元素。您可以在herehere 找到如何执行此操作的示例。

    【讨论】:

    • Thnx,作为一种方式.. 有一个缺点。我不知道安装程序中的确切字符串。我只知道我需要的 http 或/和 https。该字符串包含更多元素...
    猜你喜欢
    • 1970-01-01
    • 2010-10-23
    • 2021-11-10
    • 1970-01-01
    • 2020-07-10
    • 2016-07-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多