如果IIS服务器不支持,请不要包含https端点

时间:2012-02-10 08:05:19

标签: wix install config xml

如何在安装过程中注释配置文件的元素? 即我安装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>

1 个答案:

答案 0 :(得分:1)

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