Tobias Moe Thorstensen
Tobias Moe Thorstensen

Reputation: 8981

Configuring web.config in WiX

I have a MSI which I want to configure the bindings in a web.config. It is a standard web config and I want to change the value of security mode and transport clientCredentialType

Snippet of the web.config

<configuration>
    <system.serviceModel>
     <bindings>
      <wsHttpBinding>
        <binding name="ServerBinding" maxReceivedMessageSize="8388608" maxBufferPoolSize="1048576" >
          <readerQuotas maxStringContentLength="7000000" maxArrayLength="10000000" maxBytesPerRead="7000000" maxNameTableCharCount="7000000"  />
          <security mode="None">
            <transport clientCredentialType="None"/>
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    </system.serviceModel>
</configuration>

And the part in Configuration in wix

 <util:XmlFile Id="ServerBindingConfiguration" File="[#BioBroker.Web.config]" Action="setValue" Value="[SECURITYMODE]" ElementPath="/configuration/system.serviceModel/bindings/wsHttpBinding/binding[\[]@name='ServerBinding']/security" Sequence="1"/>

How can I change the security mode tag?

Upvotes: 0

Views: 246

Answers (1)

Isaiah4110
Isaiah4110

Reputation: 10090

You have not specified the "Name" attribute within the XMlFile element.

Name String Name of XML node to set/add to the specified element. Not setting this attribute causes the element's text value to be set. Otherwise this specified the attribute name that is set.

add Name = "mode"

Upvotes: 1

Related Questions