7

我知道如何使用 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>
4

1 回答 1

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

这应该做!

于 2012-03-27T17:11:05.493 回答