473,386 Members | 1,602 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,386 software developers and data experts.

ConfigurationSettings vs Application State

Hello

I've seen several examples around the web where people put all the
values in ConfigurationSettings.AppSettings into Application State
variables in global.asax, like this:

foreach (string key in ConfigurationSettings.AppSettings.Keys) {
Application[key] = ConfigurationSettings.AppSettings[key];
}

Does ASP.NET retreive values from Application faster than from
ConfigurationSettings.AppSettings or what's the point of this?

Just wondering if I should do the same or not...

/Mikael
Nov 18 '05 #1
1 1400
ConfigurationSettings are cached and Application comes from memory so
basically there isn't so much difference in performance. It's more about the
ability to change the information given to the application.

In .NET v1 configurationsettings in .config files are read-only and more
static by their nature. Application again
could store data without user intervention as the logic requires/does though
people probably use Cache instead of Application because of its better
features from the box. Basically if you want to change configuration yo
don't have to recompile the app, but if you change something in Application
variable, you'd need to recompile the application.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
"[myfirstname]" <"[myfirstname]"@[mylastname].com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello

I've seen several examples around the web where people put all the
values in ConfigurationSettings.AppSettings into Application State
variables in global.asax, like this:

foreach (string key in ConfigurationSettings.AppSettings.Keys) {
Application[key] = ConfigurationSettings.AppSettings[key];
}

Does ASP.NET retreive values from Application faster than from
ConfigurationSettings.AppSettings or what's the point of this?

Just wondering if I should do the same or not...

/Mikael
Nov 18 '05 #2

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

Similar topics

6
by: Rob Mayo | last post by:
I'm developing a server control for our intranet. This control is only going to be used in two applications on the server, but they must be separate. It has been established that these 2 apps...
4
by: harvie wang | last post by:
In .Net,Through System.Configuration.ConfigurationSettings Get Application's Settings I can't find the Configuration Value from Register Where the ConfigurationSettings saved? How to Read it...
3
by: Celebrate | last post by:
My application works fine when I run it locally but when I transfer it to our NEW Windows 2003 Web Edition server, I get a strange error. I've isolated the problem to when I issue a...
3
by: Random | last post by:
I'm writing a class library for my web app data access, but don't want to hard code the database connection string in the class. Nor do I want to pass the connection string in from the web app...
2
by: Dean Slindee | last post by:
What is the VS2005 version of ConfigurationSettings.AppSettings: Dim strTemp As String strTemp = ConfigurationSettings.AppSettings.Get(Application.ProductName & "/" & strKeyID)
1
by: Jenny | last post by:
Hello, I read my applications App.Config file using ConfigurationSettings.AppSettings When I try to check it's last access write time using File.GetLastWriteTime and the refresh new data...
8
by: Mark | last post by:
Could someone provide me with details or a link on how the line of code executes underneath the hood? Assume it's executed in an ASP.NET application. string blah =...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.