I have a few questions about two ways to save settings in web.config.
AppSettings : Look in web.config
<appSettings> <add key="key1" value="value1"/> <add key="key2" value="value2"/> </appSettings>
Code Usage :
ConfigurationManager.AppSettings["key1"];
ApplicationSettings / Properties (auto-generated using the "properties" tab in the project)
Take a look at web.config
<applicationSettings> <Projectname.Properties.Settings> <setting name="TestEnvironment" serializeAs="String"> <value>True</value> </setting> </Projectname.Properties.Settings> </applicationSettings>
Code Usage :
Properties.Settings.Default.TestEnvironment
So what is the difference between these two options for storing settings in web.config?
As far as I can see, the disadvantage of appSettings is that you changed the web.config file yourself, and the application settings were not printed strictly, where as the application parameters.
Both can be replaced as part of a web deployment project.
As far as I know, not used for appSettings . Am I missing something? What is historically older?
citronas Feb 28 '10 at 11:30 2010-02-28 11:30
source share