I need change the address of this configuration in a 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 my XML-Transformation file (it's working, it changes another add key value
)
I 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 it doesn't work. I don't understand why it doesn't change, if I locate by name. Any help/tip will be preciated. Thanks
If you have a web application project, Right-click on web. config and choose Add Config Transform. This will add any config transforms that are missing from your project based on build configurations (i.e. if you have Production and Staging build configs, both will get a transform added).
A transform file is an XML file that specifies how the Web. config file should be changed when it is deployed. Transformation actions are specified by using XML attributes that are defined in the XML-Document-Transform namespace, which is mapped to the xdt prefix.
A Web. config transformation file contains XML markup that specifies how to change the Web. config file when it is deployed. You can specify different changes for specific build configurations and for specific publish profiles.
Does the structure of your transformation file match your web.config? Specifically, are you missing a 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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With