Unable to access ConfigurationManager.AppSettings in a Windows Forms Application
Asked Answered
W

3

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.

Whitewing answered 25/11, 2009 at 13:17 Comment(0)
A
47

Add a reference to System.Configuration.dll.

Adipose answered 25/11, 2009 at 13:19 Comment(1)
Duh!.. Not used to winforms development--when doing web applications, everything is included by default.. Or so it seams. Thanks mate :)Whitewing
I
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.

Infantry answered 25/11, 2009 at 13:20 Comment(0)
G
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

Gustafson answered 25/11, 2009 at 13:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.