C# 如何在web.config中通过XML转换更改端点地址?

C# 如何在web.config中通过XML转换更改端点地址?,c#,xml,wcf,xslt,C#,Xml,Wcf,Xslt,我需要在web.config中更改此配置的地址: <client> <endpoint address="OLD_ADDRESS" binding="basicHttpBinding" contract="Service.IService" name="BasicHttpBinding_IService" /> </client> 但它不起作用。我不明白为什么它没有改变,如果我按名字定位的话。 任何帮助/提示都将被计算在内。谢谢转换文件的

我需要在web.config中更改此配置的地址:

<client>
  <endpoint address="OLD_ADDRESS"
    binding="basicHttpBinding"
    contract="Service.IService" name="BasicHttpBinding_IService" />
</client>
但它不起作用。我不明白为什么它没有改变,如果我按名字定位的话。
任何帮助/提示都将被计算在内。谢谢

转换文件的结构是否与web.config匹配?具体来说,是否缺少systems.serviceModel元素

<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>

<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>
<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>