[Mono-list] Reading properties from Properties.Settings.Default throws ConfigurationErrorsException

Garland garland.zero at googlemail.com
Tue May 20 15:26:15 EDT 2008


Hi everyone,

I am trying to make an application which is developed with Visual
Studio 2005/2008 working with mono. Besides the few P/Invokes problems
which I expected, there is an other problem I do not know how to fix:

Everytime the application tries to read a user setting like in the
following example

if (Properties.Settings.Default.AutoMaximize)
WindowState = FormWindowState.Maximized;

the application terminates and mono writes something like the
following to the error output:



Unhandled Exception:
System.Configuration.ConfigurationErrorsException: There is an error
in a configuration setting. () ()

  at System.Configuration.CustomizableFileSettingsProvider.LoadPropertyValue
(System.Configuration.SettingsPropertyCollection collection,
System.Configuration.SettingElement element, Boolean allowOverwrite)
[0x00000]

  at System.Configuration.CustomizableFileSettingsProvider.LoadProperies
(System.Configuration.ExeConfigurationFileMap exeMap,
System.Configuration.SettingsPropertyCollection collection,
ConfigurationUserLevel level, System.String sectionGroupName, Boolean
allowOverwrite) [0x00000]

  at System.Configuration.CustomizableFileSettingsProvider.GetPropertyValues
(System.Configuration.SettingsContext context,
System.Configuration.SettingsPropertyCollection collection) [0x00000]

  at System.Configuration.LocalFileSettingsProvider.GetPropertyValues
(System.Configuration.SettingsContext context,
System.Configuration.SettingsPropertyCollection properties) [0x00000]

  at System.Configuration.ApplicationSettingsBase.CacheValuesByProvider
(System.Configuration.SettingsProvider provider) [0x00000]

  at System.Configuration.ApplicationSettingsBase.GetPropertyValue
(System.String propertyName) [0x00000]

  at System.Configuration.ApplicationSettingsBase.get_Item
(System.String propertyName) [0x00000]

  at GView.Properties.Settings.get_AutoMaximize () [0x00000]

  at GView.GVForm..ctor (System.String[] args) [0x00000]

  at (wrapper remoting-invoke-with-check) GView.GVForm:.ctor (string[])

  at GView.Program.Main (System.String[] args) [0x00000]


Surprisingly I was unable to found much information online, neither
about how good mono's support for this
Properties.Settings.Default-thing is at the moment nor about why i
might get this exception or what to do. Can somebody help me?

Garland


More information about the Mono-list mailing list