有没有一种有效的方法来为.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转换,但这些转换似乎使整个配置过程过于简洁。
发布于 2017-01-27 00:43:31
SlowCheetah。NuGet package。Visual Studio extension (可选)。
https://stackoverflow.com/questions/41860006
复制相似问题