c# - How to change an endpoint address with XML Transformation in web.config? -
i need change address of configuration in web.config:
<client> <endpoint address="old_address" binding="basichttpbinding" contract="service.iservice" name="basichttpbinding_iservice" /> </client>
to this:
<client> <endpoint address="new_address" binding="basichttpbinding" contract="service.iservice" name="basichttpbinding_iservice" /> </client>
in xml-transformation file (it's working, changes add key value
)
have this:
<configuration xmlns:xdt="http://schemas.microsoft.com/xml-document-transform"> <client> <endpoint name="basichttpbinding_iservice" address="new_address" xdt:transform="setattributes" xdt:locator="match(name)"/> </client>
but doesn't work. don't understand why doesn't change, if locate name. help/tip preciated. thanks
does structure of transformation file match web.config? specifically, missing systems.servicemodel element?
<configuration xmlns:xdt="http://schemas.microsoft.com/xml-document-transform"> <system.servicemodel> <client> <endpoint name="basichttpbinding_iservice" address="new_address" xdt:transform="setattributes" xdt:locator="match(name)"/> </client> </system.servicemodel> </configuration>
Comments
Post a Comment