I have a Wcfservice that uses Wix for setup.
During installation I have a Gui that collects different settings and then changes these settings in Product.wxs. But I'm having difficulty finding the baseAddress setting I want to change.
My config file has this section:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="Default">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="Default" name="OurServiceLibrary.OurService">
<clear/>
<endpoint name="OurBasicHttpBinding" address="basic" binding="basicHttpBinding" contract="OurServiceLibrary.IOurService" listenUriMode="Explicit"/>
<host>
<baseAddresses>
<!-- The base-address must be updated with the correct url for the hosting machine. -->
<add baseAddress="http://localhost:8081/ourservice"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
And the code I'm using when I try to change the setting is:
<!--Put path to settings in local variable-->
<?define ServiceModelSettingsPath="//configuration/system.ServiceModel/services/service/host/baseAddresses/" ?>
<!--Modify settings with values entered in the installation UI-->
<util:XmlFile Id="ModifyServiceBaseAdress"
Action="setValue"
Permanent="yes"
ElementPath="$(var.ServiceModelSettingsPath)/add"
Name ="baseAddress"
File="[#OurServiceSettingsFile]"
Value="connectionString=[SERVICEBASEADRESS_VALUE]"
SelectionLanguage="XPath"
Sequence="1" />
When trying to run the setup I get an error saying that "Failed to find node: //configuration/system.ServiceModel/services/service/host/baseAddresses//add in XML file"
Obviously the path to the node is wrong but I can't see how, can anyone help me?