Nested appSettings keys?

B

Brett Williams

Hi all,

Does anyone know if it is possible to nest appSettings keys/values?
At my work, we have apps that deploy across multiple environments
(dev, test, live) - nothing new there. What we're trying to accomplish
is the ability to keep the *.config file the same across the
environments, and have the app itself determine which key values it
should use, based upon environment:

<appSettings>
<add key="server" value="some.live.server">
<add key="strConnDB1" value="Server=database.server...">
<add key="strConnDB2" value="Server=database.server...">
</add>

<add key="server" value="some.test.server">
<add key="strConnDB1"
value="Server=different.database.server...">
<add key="strConnDB2"
value="Server=diferent.database.server...">
</add>

<add key="server" value="some.dev.server">
<add key="strConnDB1" value="Server=dev.database.server...">
<add key="strConnDB2" value="Server=dev.database.server...">
</add>
</appsettings>

Does anyone know if this kind of thing is possible? (Obviously, the
above doesn't work - I've tried it, but I'm wondering if there's a way
to nest them and I just don't know how to do it properly).

Thanks,
Brett Williams.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top