[Mono-list] Using System.Config.AppSettingsReader

Daniel Soto daniel.soto2k at gmail.com
Wed Nov 11 09:27:04 EST 2009


Hello.

You must have an configuration file called App.config in the host program
that uses your class library.

If you target to the runtime .NET/Mono 2.0 or above, you can use
System.Configuration.ConfigurationManager.AppSettings["your_key"] to get the
values.

If you compile your app, it must be renamed to Your_App.exe.config.

In my project this is that I do.

Regards.

2009/11/11 Costantino Pipero <cos at beeond.net>

>  I have a class library project and I created a configuration file
>
> <configuration>
>     <appSettings>
>         <add key = "ImagesFolder" value = "/user/home/somefolder/" />
>     </appSettings>
> </configuration>
>
> I was looking into the documentation but it's missing on how to use the
> AppSettingsReader class:
>
> 1 - how do I tell it which file to use?
> 2 - does it understand <appSettings> ?
>
> I wonder if anyone out there has used it successfully. Thank you so much
> for your advice
>
> Cos
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20091111/7e21a5d5/attachment.html 


More information about the Mono-list mailing list