[MonoDevelop] Accessing configuration files
Ahmed Abdeen Hamed
ahmed.elmasri at gmail.com
Sun Oct 10 14:55:44 EDT 2010
My apologies for the second email but the correct syntax for the first
line is this:
NameValueCollection appSettings = ConfigurationManager.AppSettings
Here is the error:
/Users/aabdeen/Projects/console-project/console-project/Main.cs(51,51):
Error CS0103: The name `ConfigurationManager' does not exist in the
current context (CS0103) (console-project)
On Sun, Oct 10, 2010 at 2:44 PM, Ahmed Abdeen Hamed
<ahmed.elmasri at gmail.com> wrote:
> Hello,
> I am unable to access the solution configuration file using the C#
> code. For some reason it can't find the classes from the
> System.Configuration reference even though it has been imported via
> using statement. Here is the code snippet:
>
>
> NameValueCollection appSettings = Configuration.AppSettings;
>
> for (int i = 0; i < appSettings.Count; i++)
> {
> Console.WriteLine("Key : {0} Value: {1}",
> appSettings.GetKey(i), appSettings[i]);
> }
>
> Here is the error message:
> /Users/aabdeen/Projects/console-project/console-project/Main.cs(51,51):
> Error CS0103: The name `Configuration' does not exist in the current
> context (CS0103) (console-project)
>
> Any clue?
> Thanks,
> Ahmed
>
More information about the Monodevelop-list
mailing list