I know how to change the value of attributes with SlowCheetah, but how would I change the value of the element.
app.Debug.config:
<applicationSettings>
<MyProgram.Properties.Settings>
<setting name="aName" serializeAs="String">
<value>myName</value>
</setting>
</MyProgram.Properties.Settings>
</applicationSettings>
This was my failed attempt in 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>
This package allows you to automatically transform your app. config (or any file) when you press F5 in Visual Studio. You can have different transformations based on the build configuration. This will enable you to easily have different app settings, connection strings, etc for Debug versus Release.
The xdt:Transform attribute value "SetAttributes" indicates that the purpose of this transform is to change attribute values of an existing element in the Web. config file.
A transform file is an XML file that specifies how the Web. config file should be changed when it is deployed. Purpose of These Files. The purpose of these files is to generate a new Web.config file depending upon the environment. It's extremely useful to store settings in these files, for example.
<applicationSetting>
<MyProgram.Properties.Settings>
<setting name="aName" serializeAs="String" xdt:Locator="Match(name)">
<value xdt:Transform="Replace">newName</value>
</setting>
</MyProgram.Properties.Settings>
</applicationSetting>
This should do it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With