.NET Framework Bookmark and Share   
 index > Common Language Runtime > Application Configuration Versus Application Settings
 

Application Configuration Versus Application Settings

Hello all,

I am new to this community. I've Visual Studio 2008 Sp1 installed on windows 7 RC1. Can somebody here explain me about Application Configuration and Application Settings. I think these 2 are very similar. And in what situation should I choose one over another?

One more thing, I can see that in the case of application configuration, all the information is saved in an XML file and stay in a seperate file, appname.exe.config, in the same directory as the main assembly. but in the case of application settings, can you tell me when I store some information and its type is application, and when I deploy the assembly, where is the information stored? is it inside the assembly or in a seperate file and where is that file if it is the case?


Thanks,

nsophat20
dara kok
I cannot explain as much as you expected but try this,
Application configuration files,
http://www.developer.com/net/net/article.php/3396111
Application Settings,
http://msdn.microsoft.com/en-us/library/k4s6c3a0.aspx

Hope this will give you an idea as well as to me also,
Regards,
AUmidh
Hi Kok,
I got a little confused about your last question, but I have something to share with you:
1. We can access those Application Setting by using System.Configuration.ConfigurationManager.AppSettings["your key1"],
2. The Application Settings are stored in a global cache, and its value is loaded from disk at the first time you access it using System.Configuration.ConfigurationManager.AppSettings["your key1"].
3. If the .config file was deleted before ConfigurationManager load it, you cannot get appsetting values and your application may run into invalid status or crash. If the .config file was deleted after been loaded, you still can get appsetting from the global cache.

Thanks,
Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help.
  • Marked As Answer bydara kok Thursday, September 17, 2009 11:08 AM
  •  
eryang
I cannot explain as much as you expected but try this,
Application configuration files,
http://www.developer.com/net/net/article.php/3396111
Application Settings,
http://msdn.microsoft.com/en-us/library/k4s6c3a0.aspx

Hope this will give you an idea as well as to me also,
Regards,
AUmidh
Another link
http://www.builderau.com.au/program/web/soa/Store-NET-application-settings-in-custom-XML-config-files/0,339024632,320265625,00.htm
AUmidh
ThankAUmidhfor your comments.

Now i have a better understanding of the way configuration works.

Can you answer me one more thing? When i have app.config defined in my project, and when i create a new property in application setting, the new property is reflected in the app.config file. So I wonder where the application setting property is stored in case i delete the app.config file.
dara kok
Hi Kok,
I got a little confused about your last question, but I have something to share with you:
1. We can access those Application Setting by using System.Configuration.ConfigurationManager.AppSettings["your key1"],
2. The Application Settings are stored in a global cache, and its value is loaded from disk at the first time you access it using System.Configuration.ConfigurationManager.AppSettings["your key1"].
3. If the .config file was deleted before ConfigurationManager load it, you cannot get appsetting values and your application may run into invalid status or crash. If the .config file was deleted after been loaded, you still can get appsetting from the global cache.

Thanks,
Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help.
  • Marked As Answer bydara kok Thursday, September 17, 2009 11:08 AM
  •  
eryang

You can use google to search for other answers

Custom Search

More Threads

• A managed application may crash silently when an unmanaged C++ client passes a NULL pointer to receive an array output parameter.
• AppDomain RelativeSearchPath
• Error in CLR Profiler
• How to code an NT Service (in C#) so it can be run from the command line as well?
• System.Configuration: The entry '' has already been added.
• Optimized Moves Using DoDragDrop
• FileIOPermission in WinControl hosted in IE
• sinking com events in vb.net - multiple events
• Any Performance comparison between .NET CF 2.0 & 3.5?
• problem with CLR dll, but only in debuger