wixwix3

Wix update bindingRedirect value


I have an installer which needs to change the bindingRedirect value in the app.config. Currently, I have:

    <util:XmlFile Id="Config"
      Action="setValue"
      ElementPath="configuration/runtime/assemblyBinding/dependentAssembly/assemblyIdentity[\[]@publicKeyToken='89845dcd8080cc91'[\]]/bindingRedirect/@newVersion"
      File="[INSTALLFOLDER]\app.config"
      Value="13.0.0.0"/>

but this is throwing an error as it cant find the node. I'm guessing this is because bindingRedirect isn't a child element of assemblyIdentity.

How would I go about updating the newVersion field?

Thanks


Solution

  • This is the resolution to this problem, should anyone else hit this issue!

        <util:XmlFile Id="Config"
          Action="setValue"
          ElementPath="configuration/runtime/assemblyBinding/dependentAssembly[\[]assemblyIdentity/@publicKeyToken='89845dcd8080cc91'[\]]/bindingRedirect/@newVersion"
          File="[INSTALLFOLDER]\app.config"
          Value="13.0.0.0"/>
    

    and the assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" in the config file needs to be changed to assemblyBinding