[Mono-osx] ConfigurationErrorsException loading user settings (duplicate key)

Tomasz Muszyński thom at union.waw.pl
Thu Jan 22 06:15:53 EST 2009


Matt Emson pisze:
> d_v wrote:
>   
>> Hi and thanks Matt.
>>
>> I am using a "config" file called: <MyUploader_App>.exe.config in my Windows
>> Form Application .exe root path.   
>> It is created automagically by VS 2005.NET.
>> I experienced the errors on Mon0 2.2_5 (latest) version on Mac OS X 10.5.6
>>     
> VS 2005 wants you to use the automatic Class/config file mapping 
> mechanism that MS.Net2.0 pushes, but I'd suggest using the simpler 
> <appSettings> functionality. It's less opaque and simpler to get going 
> and should work on all platforms that support .Net 1.x onwards. See my 
> eariler email for the details.
>   

You are almost right - appSettings are simpler to use, but also gives 
you very limited functionality, where you can only make simple key/value 
pairs where values are always strings. In ConfigurationSettings from 
.Net 2.0 you can store any value that you need (simple types, complex 
types, collections, etc). It's better to know why Applications Scope 
settings are not working on Mono and OS X (if I have some free time, 
i'll try to check this in next days). Maybe Mono tries to find config 
file in wrong path?

ConfigurationSettings from .Net 2.0 also can be used programaticially 
without class generations in Vistual Studio.

Regards,

-- 
Tomasz Muszyński





More information about the Mono-osx mailing list