StringCollection app.config

I have an app settings that is a type of Specialized.StringCollection, its stored in the app.config as:

<setting name="settingName" serializeAs="Xml">
	<value>
		<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
			<string>string1</string>
			<string>‎string2</string>
		</ArrayOfString>
	</value>
</setting>

Is there anyway of changing the value of string1\string2 during a deployment? I’ve tried putting the ArrayOfString node into a variable but it XML encodes it when updating the app.config.

Hi Badger,

Thanks for getting in touch! You would have to use the ‘substitute variables in files’ feature to make those substitutions. Creating a variable for both string1 and string2 then defining them in the config as #{String1} and #{String2}. You will have to name the config file in the list of files to check.

Hope that helps!
Vanessa

Hi, I am trying to do this with my web.config, after the tranformations have taken place. But the variables are not replaced and remain unchanged in the actual web.config that is deployed.

I have the file listed in the files and the checkbox is checked.

What am I doing wrong?

<globalization requestEncoding="UTF-8" responseEncoding="UTF-8" uiCulture="#{uiculture}" culture="#{culture}" xdt:Transform="Replace" />

Hi Jim,

You need to turn on the ‘Substitute variables in files’ feature and define the config file explicitly. Please see my screenshots. Also do not forget to create a new release after making these changes.

Vanessa