Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>When using the configuration merge, it's best to handle each level of the block separately.</p> <p>First up, your example only tries to avoid collision on the /configuration element, which is in every web.config file.</p> <p>Next up, you need to separate out each part - this is important for the uninstall as well.</p> <p>In your example, you've got several levels - <code>&lt;system.servicemodel&gt; , &lt;bindings&gt;, &lt;basicHttpBinding&gt;</code> etc.</p> <p>What you need to do is split out these independently so they can be identified by the 'key' of each element (ie name, address - whatever it is). This allows the merge engine to identify a collision and do the update.</p> <p>The following is just a guess, but should be a useful jumping off point. It's not easy to figure out and the documentation in this area is a bit sparse. I ended up deep-diving into the source code to figure this one out myself.</p> <pre><code>&lt;component type="Config"&gt; &lt;config&gt; &lt;configFile&gt;web.config&lt;/configFile&gt; &lt;install&gt; &lt;configuration&gt; &lt;nodes&gt; &lt;node path="/configuration" targetpath="/configuration/system.serviceModel" action="update" collision="ignore"&gt; &lt;system.serviceModel&gt; &lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;/basicHttpBinding&gt; &lt;/bindings&gt; &lt;client&gt; &lt;/client&gt; &lt;/system.serviceModel&gt; &lt;/node&gt; &lt;node path="/configuration/system.serviceModel/bindings/basicHttpBinding" action="update" key="name" collision="overwrite"&gt; &lt;binding name="xxx"&gt; &lt;/binding&gt; &lt;/node&gt; &lt;node path="/configuration/system.serviceModel/client" action="update" key="address" collision="overwrite"&gt; &lt;endpoint address="http://xxx" binding="basicHttpBinding" bindingConfiguration="xxx" contract="xxx" name="xxx" /&gt; &lt;/node&gt; &lt;/nodes&gt; &lt;/configuration&gt; &lt;/install&gt; &lt;/config&gt; &lt;/component&gt; </code></pre> <p><strong>Edit:</strong> The targetpath-attribute has to be written in lower case, otherwise the installer will create duplicate elements. (Original answer: targetPath)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload