Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ConfigurationManager missing (?)

Status
Not open for further replies.

phinoppix

Programmer
Jul 24, 2002
437
US
I'm trying to access System.Configuration.Configuration or the ConfigurationManager class on .net 2. The ConfigurationSettings seem to keep showing up in the intellisense and if I use it, the compiler warns me that it's obsolete and I should use the former.

I looked on the object browser (and project explorer) to verify if I'm referencing the correct assembly, and I am. Does anyone have a clue? Was there some sort of mix-up on my installation?

I have IDE 2003 and 2005 on my machine, but I only open one IDE version at a time.
 
You need to add a reference to System.Configuration, then you can use:
Code:
Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);

Console.WriteLine(config.AppSettings.Settings["YourSetting"].Value);
 
Hi,

I've done that, but to no avail. I think some registry settings got messed up because I just found out I can't compile the deployment project anymore.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top