【问题标题】:How to change specific value node in web.config through xmlpoke?如何通过xmlpoke更改web.config中的特定值节点?
【发布时间】:2012-01-31 18:34:47
【问题描述】:

我正在使用 Nant 进行构建过程。我需要更改我的web.config 文件来设置端点地址。 我的 web.config 文件包含 5 个端点地址,我需要更改名称类似于“service1”的那些节点的端点地址

<endpoint address="" binding="wsHttpContextBinding"

 bindingConfiguration="WSHttpContextBinding_Iservice1" contract="xyz" name="**service1**">

【问题讨论】:

    标签: .net build nant


    【解决方案1】:

    您需要创建一个调用xmlpoke的目标

    示例代码:

    <xmlpoke
    file="Web.config"
    xpath="/configuration/system.ServiceModel/services/service/endpoint[@name = 'service1']/@address"
    value="127.0.0.1:8080" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-29
      • 1970-01-01
      • 2012-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-15
      相关资源
      最近更新 更多