Hi,
I am creating a user control using VS2008 & .NET 3.5in which I would like to retrieveAppSettings from an app.config file. The following line of code works fine in a Windows Forms app, but not in a UserControl:
Code Snippet
string
strLogFile = ConfigurationManager.AppSettings["LogFile"].ToString();
It complains that "ConfigurationManager" does not exist in the current context. I have included the appropriate using statement:
Code Snippet
using
System.Configuration;
The user controlwill build & run ok if I substitute ConfigurationSettings for ConfigurationManager, but that is deprecated and returns null in any case, so it is moot.
Does anyone have any idea why I cannot use ConfigurationManager in a user control?
Thanks.
Dan