Alternatives to calling XMLPoke over and over for build configurations (MSBuild or NANT)?

314 Views Asked by At

Is there an efficient way to build out large configs (many properties that need to be set) for .NET Projects? XMLPoke is great for a small number of changes, but it doesn't scale well for large more complex projects with many properties to set.

Here is a small excerpt from one of my current config files:

[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'.

I don't want to keep doing this dozens and dozens of times against configs for multiple services.

I've looked into MSBuild Transformations, but these seem to make the whole configuration process overly terse.

1

There are 1 best solutions below

2
weir On

SlowCheetah. NuGet package. Visual Studio extension (optional).