我正在尝试为不同的情况(调试,发布等)制作不同的配置文件,我想更改不同构建的一些设置.
<configuration> <applicationSettings> <Program1.Properties.Settings> <setting name="CustomerId" serializeAs="String"> <value>Custormer1-13256</value> </setting> </Program1.Properties.Settings> </applicationSettings> </configuration>
ex. <value>Customer2-343242</value>
解决方法
将xdt:Locator =“Match(name)”添加到
Erwin’s answer
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <applicationSettings> <Program1.Properties.Settings> <setting name="CustomerId" serializeAs="String" xdt:Transform="Replace" xdt:Locator="Match(name)"> <value>Customer2-343242</value> </setting> </Program1.Properties.Settings> </applicationSettings>