16

How can I access ConfigurationManager.AppSettings in my Windows Forms Application?

The error message reads: The name 'ConfigurationManager' does not exist in the current context.

Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
cllpse
  • 21,396
  • 37
  • 131
  • 170

3 Answers3

47

Add a reference to System.Configuration.dll.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • Duh!.. Not used to winforms development--when doing web applications, everything is included by default.. Or so it seams. Thanks mate :) – cllpse Nov 25 '09 at 13:24
3

I've had this experience before where I had to go and add a reference to System.Configuration to be able to use this funcitonality.

Tinidian
  • 153
  • 4
3

Right click on your project in the solution explorer, select Add Reference then select the .Net tab (it should be selected by default), and select System.Configuration

Mick Walker
  • 3,862
  • 6
  • 47
  • 72