我知道如何使用SlowCheetah更改属性的值,但我如何更改元素的值。
app.Debug.config:
<applicationSettings>
<MyProgram.Properties.Settings>
<setting name="aName" serializeAs="String">
<value>myName</value>
</setting>
</MyProgram.Properties.Settings>
</applicationSettings>
这是我在app.Staging.config中失败的尝试:
<applicationSetting>
<MyProgram.Properties.Settings>
<setting name="aName" serializeAs="String">
<value xdt:Transform="Replace" xdt:Locator="Match(value)">newName</value>
</setting>
</MyProgram.Properties.Settings>
</applicationSetting>
答案 0 :(得分:15)
<applicationSetting>
<MyProgram.Properties.Settings>
<setting name="aName" serializeAs="String" xdt:Locator="Match(name)">
<value xdt:Transform="Replace">newName</value>
</setting>
</MyProgram.Properties.Settings>
</applicationSetting>
应该这样做!