问题
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.
回答1:
Add a reference to System.Configuration.dll.
回答2:
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.
回答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
来源:https://stackoverflow.com/questions/1796851/unable-to-access-configurationmanager-appsettings-in-a-windows-forms-application