I have an MSI installer built using Wix 3.5 and I am trying to edit a web.config xml file during installation using this:
<Component Id="EditWebConfigToUseCertificate" Guid="xxx">
<util:XmlConfig Id="configureX509Value"
File="[WebServiceFolder]web.config"
ElementPath="configuration/system.serviceModel/behaviors/serviceBehaviors/behavior[\[]1[\]]/serviceCredentials/serviceCertificate"
Name="x509FindType"
Value="FindBySubjectName"
Sequence="1" />
</Component>
I can't make it work, i can't make it change any attribute on the file. The MSI installs fine, but the web.config is never changed. I checked the file path (hardcoding it) and also the XPath is correct. Why isn't it modifying the file? The installation log shows no error.
This is my web.config:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E31" />
</assemblies>
</compilation>
<!-- do not use asp.net authentication -->
<authentication mode="None" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<clear />
<behavior name="AuthenticationServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<!-- service credentials -->
<serviceCredentials>
<serviceCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindBySerialNumber" findValue="00 91 d9 2e 07 82 d8 99 c0" />
</serviceCredentials>
</behavior>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<!-- service credentials -->
<serviceCredentials>
<serviceCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindBySerialNumber" findValue="00 91 d9 2e 07 82 d8 99 c0" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
</configuration>