From: dw on
On Fri, 27 Nov 2009 15:39:14 +0000, Nick Gilbert
<nickg(a)newsgroup.nospam> wrote:

>> Can you people answer my third question..
>> <appsettings>
>> <add key="" value=""/>
>> </appsettings>
>> How many of the above "add" elements i can store in the web.config?
>
>No limit, but if you're thinking of putting more than about 20 things in
>here, then you're probably using it for the wrong purpose! This is only
>for storing configuration information. Don't try and store actual data
>in the web.config file - you should use a proper database for that.
>
>None of my sites have more than 10-12 things in them. Mainly it's for
>configuring things which are different on each server - like email
>addresses for sending notifications to, or paths to folders on the hard
>disk for that particular version of the site.
>
>Every time you change web.config, the application has to be restarted
>and any users on the site will be logged out unless you're using the
>session state server. So don't put anything here which changes often.
>You shouldn't need to edit web.config unless you've made some major
>changes to the site. Anything else belongs in a database.
>
>Nick.

If you have a large number of AppSettings items, you could create a
second file (name it myAppSettings or whatever), listing all your
appsettings there, and in your web.config file, just refer to that
other file
<appSettings configSource="myAppSettings.config"/>

This way, also, if you make an addition to the myappsetings file, it
won't restart the entire application.

David Wier
http://aspnet101.com