473,378 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Nested appSettings keys?

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.
Nov 18 '05 #1
0 1030

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: omission9 | last post by:
I have a dictionary that looks like this MY_DICT=FOO I am having a problem updating this with a simple MY_DICT.update(NEW_DICT) as update doesn't seem to care about getting into the inner...
2
by: Kenneth | last post by:
Hi, In web.config I have an appsettings: <appSettings> <add key="constring" value="Server=localhost;UID=sa;PWD=secret;Database=myDB" /> </appSettings> This is for my developing machine.
0
by: Brett Williams | last post by:
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...
4
by: Robert Pfeffer | last post by:
Hi, I have a rather unusual problem. I have a very simple ASP.NET application, basically hello world type. I created it with Visual Studio 2003 and am running it in debug mode. It runs fine...
4
by: Dr. Paul Caesar - CoullByte (UK) Limited | last post by:
We have a contact us page that is used throughout our sites. I have over the last few days modified all sites to obtain information from Application Settings. It is a simple form that when ran...
2
by: Fuehner | last post by:
Everyone-- I installed the .NET 2.0 framework on a server that also has version 1.1 installed. A few of my applications override the "appSettings" section in the web.config with a custom config...
1
by: Sergei Shelukhin | last post by:
Hi. Is is possible to divide appSetting in two, having some values stored in web.config itself and some in a section referenced in appSettings file="...." attribute?
2
by: =?Utf-8?B?R29sZHdpbmQ=?= | last post by:
Hi, There is something fundamental which i donn't get it. I created a new Win Forms project in dotNet 2.0. I added Keys and Values to the settings. When I use...
1
by: Sylvie | last post by:
I am Developing a web application and reading connection strings from Web.Config file, How can I write appSettings keys programmaticaly via a web page ? Thanks <?xml version="1.0"?> ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.