【问题标题】:Alternatives to calling XMLPoke over and over for build configurations (MSBuild or NANT)?为构建配置(MSBuild 或 NANT)一遍又一遍地调用 XMLPoke 的替代方法?
【发布时间】:2017-06-11 03:07:18
【问题描述】:

有没有一种有效的方法来为 .NET 项目构建大型配置(需要设置许多属性)? XMLPoke 非常适合进行少量更改,但不适用于需要设置许多属性的大型更复杂项目。

这是我当前配置文件之一的一小段摘录:

[xmlpoke] Found '1' nodes matching XPath expression '/configuration/xyz.com/memcached/servers'.
  [xmlpoke] Found '1' nodes matching XPath expression '/appSettings/add[@key='ServiceName']/@value'.
  [xmlpoke] Found '1' nodes matching XPath expression '/appSettings/add[@key='DomainLoaderOptimization']/@value'.
  [xmlpoke] Found '1' nodes matching XPath expression '/appSettings/add[@key='MessageQueueProvider']/@value'.
  [xmlpoke] Found '1' nodes matching XPath expression '/appSettings/add[@key='DistributedCacheProvider']/@value'.
  [xmlpoke] Found '1' nodes matching XPath expression '/appSettings/add[@key='DistributedStateProvider']/@value'.
  [xmlpoke] Found '1' nodes matching XPath expression '/appSettings/add[@key='RedisHost']/@value'.
  [xmlpoke] Found '1' nodes matching XPath expression '/appSettings/add[@key='RedisHost.Batch']/@value'.
  [xmlpoke] Found '1' nodes matching XPath expression '/appSettings/add[@key='XYZService-ServiceUrlPrefix']/@value'.
  [xmlpoke] Found '1' nodes matching XPath expression '/appSettings/add[@key='PQRService-ServiceUrlPrefix']/@value'.
  [xmlpoke] Found '1' nodes matching XPath expression '/appSettings/add[@key='MNBOPUrlPrefix']/@value'.

我不想针对多个服务的配置继续这样做几十次。

我研究了 MSBuild 转换,但这些似乎使整个配置过程过于简洁。

【问题讨论】:

    标签: xml xslt msbuild nant xmlpoke


    【解决方案1】:

    慢猎豹。 NuGet package。 Visual Studio extension(可选)。

    【讨论】:

    • Visual Studio 链接已损坏
    • 已修复。谢谢@CarlaCamargo!
    猜你喜欢
    • 1970-01-01
    • 2015-07-15
    • 2019-06-08
    • 1970-01-01
    • 2021-05-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多