App.config settings, environment variable as partial path
- by Jean-Bernard Pellerin
I'm new to tinkering with app.config and xml, and am currently doing some refactoring in some code I haven't written.
Currently we have a snippet which looks like this:
<setting name="FirstSetting" serializeAs="String">
<value>Data Source=C:\Documents and Settings\All Users\ApplicationData\Company ...;Persist Security Info=False</value>
What I'd like to do is have it instead point to something like ${PROGRAMDATA}\Company\...
How can I achieve this, keeping in mind that PROGRAMDATA will not always point to C:\ProgramData ?