472,807 Members | 3,571 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,807 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 1370
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 =...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.