I'm trying to create an installer authored in WiX, and while I think my code is correct based on other examples that I've found, the XML file is not being updated on installation. I'm trying to use a value that the user inputs into the installer UI to update the value of a key-value pair in the config file. The pair already exists in the file with a default value set, so I would like the user to be able to overwrite that value from the installer UI. I've looked at questions here with similar issues, but none of those fixes seem to work for me.
Here is a code snippet of what I have:
<Component>
<File Source="$(var.DIR)\file.exe.config" />
<util:XmlFile
Id="ServerNameUpdate"
File=[INSTALLFOLDER]file.exe.config
Action="setValue"
ElementPath="/configuration/appSettings/add[\[]@key='ServerURL'[\]]/@value"
Name="value"
Value="http://[SERVER]/
Sequence="1" />
</Component>
I'm not getting any errors, but my config file is not changing on installation. the XML line should look like this:
<add key='ServerURL' value='http://[SERVER]/' />
Even if I use a hardcoded Value, the value is not changed. Is there something wrong with my code?