Xdt: transform with similar attributes

I have a config file that contains WCF settings:

<host>
    <add baseAddress="net.tcp://myaddress.com:12345/MyService"/>
    <add baseAddress="net.tcp://anotheraddress:67890/MyOtherService"/>
</host>

      

The 'add' element only has a baseAddress attribute, so I cannot use the Match locator. How could multiple elements be converted like in my example?

+3


source to share


1 answer


As a result, I moved xdt: Transform = "Replace" to the parent node, for example:



<host xdt:Transform="Replace">
    <add baseAddress="net.tcp://myaddress.com:12345/MyService"/>
    <add baseAddress="net.tcp://anotheraddress:67890/MyOtherService"/>
</host>

      

+3


source







All Articles