2012-03-26 84 views
5

我知道如何使用SlowCheetah更改屬性的值,但是如何更改元素的值。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> 

回答

13
<applicationSetting>  
    <MyProgram.Properties.Settings>  
    <setting name="aName" serializeAs="String" xdt:Locator="Match(name)">   
     <value xdt:Transform="Replace">newName</value>  
    </setting>  
    </MyProgram.Properties.Settings> 
</applicationSetting> 

這應該這樣做!

+0

用戶設置呢? – Edmondo1984 2013-01-14 17:04:26

相關問題