Geekpedia Programming Tutorials






Geekpedia / Programming FAQ / .NET 1.1 / 2.0 / In .NET 2.0 accessing the values stored in web.config through System.Configuration.ConfigurationSettings.AppSettings doesn't seem to work anymore

In .NET 2.0 accessing the values stored in web.config through System.Configuration.ConfigurationSettings.AppSettings doesn't seem to work anymore



In .NET 2.0 System.Configuration.ConfigurationSettings.AppSettings has been changed to System.Configuration.ConfigurationManager.AppSettings. Also you need to add a reference to System.Configuration.dll.
Here's an example of accessing the SomeString value from the web.config file, in .NET 2.0:

System.Configuration.ConfigurationManager.AppSettings["SomeString"];


by Andrew Pociu at May, 19 2005 - 04:51 | 8134 hits

china - Dec 21 2005 - 04:27

thanks


Thanky - Sep 27 2006 - 23:28

Thank you Andrei
I was looking for this info for long time
you really help me much
thank you again


James Taylor - Feb 16 2007 - 05:08

Thank you for this useful piece of advice.


Nikki J. - Aug 25 2007 - 02:07

Thankx a lot!!


Sue - Oct 08 2007 - 16:05

Brilliant. Thank you. It would 8 hrs for me to find this post, but it was well worth the wait.


Elton - Nov 02 2007 - 03:34

when I use it, iT says
The type or namespace name 'ConfigurationManager' does not exist in the namespace 'System.Configuration' (are you missing an assembly reference?)

do you know why?


JMTZ - Nov 16 2007 - 19:27

you have to add a reference to System.Configuration



Add your comment:
Name:
Email:
Comment:
Please enter the Verification value character in the text box:
Latest Tech Bargains

Advertisement

Free Magazine Subscriptions

Today's Pictures

Today's Video

Other Resources

Latest Download

Latest Icons