[Mono-winforms-list] Exception retrieving User application setting
Erik Renes
keenriser at planet.nl
Wed Nov 21 14:26:21 EST 2007
1.2.5.1 on Vista gives a similar error:
NRE, but in another method ( CustomizableFileSettingsProvider.GetCompanyName
).
After a bit of fiddling, I got the debugger to attach to the crashing exe
(also in .net if I copied the GetCompanyName method local) and the problem
in 1.2.5.1 is the following line:
if (entryType != null && entryType.Namespace.Length > 0)
Namespace is null, which is not checked, while it is a valid value according
to MSDN documentation:
http://msdn2.microsoft.com/en-us/library/system.type.namespace.aspx
"The namespace of the Type, or a null reference (Nothing in Visual Basic) if
the current instance represents a generic parameter."
I'm pretty sure this kind of discussion doesn't belong here, but I don't
have an account on the bugtracker. So if anyone would like to add it, please
do. I think it would be a rather easy fix (for 1.2.5) from here :)
It seems that this is a bit different from 1.2.6 I suppose, but still every
vulnerability less is one :)
Regards,
Erik.
-----Original Message-----
From: mono-winforms-list-bounces at lists.ximian.com
[mailto:mono-winforms-list-bounces at lists.ximian.com] On Behalf Of Andrus
Sent: woensdag 21 november 2007 19:16
To: Mono-winforms-list at lists.ximian.com
Subject: Re: [Mono-winforms-list] Exception retrieving User application
setting
https://bugzilla.novell.com/show_bug.cgi?id=343459
Settings: NRE caused by app.config file
I do'nt have 1.2.5 installed to try.
Andrus.
> File a bug. Is this new to 1.2.6 or does it fail on 1.2.5 as well? I
> don't think anyone has done any work on configuration in quite some time.
>
> Thanks!
> Jon
>
> Andrus wrote:
>> Trying to retrieve user application settings causes exception.
>>
>> How to fix ?
>>
>> Andrus.
>>
>> MONO 1.2.6 preview 2
>> .NET 2 profile
>> Windows XP
>>
>> System.Configuration.ConfigurationException: Duplicate element in
>> collection
>> ()
>> at System.Configuration.ConfigurationElementCollection.BaseAdd
>> (System.Configuration.ConfigurationElement element, Boolean
>> throwIfExists)
>> [0x00000]
>> at System.Configuration.ConfigurationElementCollection.BaseAdd
>> (System.Configuration.ConfigurationElement element) [0x00000]
>> at
>>
System.Configuration.ConfigurationElementCollection.OnDeserializeUnrecognize
dElement
>> (System.String elementName, System.Xml.XmlReader reader) [0x00000]
>> at System.Configuration.ConfigurationElement.DeserializeElement
>> (System.Xml.XmlReader reader, Boolean serializeCollectionKey) [0x00000]
>> at System.Configuration.ConfigurationSection.DeserializeSection
>> (System.Xml.XmlReader reader) [0x00000]
>> at System.Configuration.Configuration.GetSectionInstance
>> (System.Configuration.SectionInfo config, Boolean createDefaultInstance)
>> [0x00000]
>> at System.Configuration.ConfigurationSectionCollection.get_Item
>> (System.String name) [0x00000]
>> at
>>
>>
System.Configuration.ConfigurationSectionCollection+<>c__CompilerGenerated0.
MoveNext
>> () [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) [0
> x00
>> 000] at System.Configuration.ApplicationSettingsBase.get_Item
>> (System.String propertyName) [0x00000] at
>> MyApp.Windows.Forms.Properties.Settings.get_Server () [0x00000] at
>> MyApp.Windows.Forms.UserLoginForm.InitializeComponent () [0x00000] at
>> MyApp.Windows.Forms.UserLoginForm..ctor () [0x00000] at (wrapper
>> remoting-invoke-with-check) MyAppWindows.Forms.UserLoginForm:.ctor () at
>> MyApp.AppMainEntry.Main () [0x00000]
>> _______________________________________________
>> Mono-winforms-list maillist - Mono-winforms-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>>
>>
>
_______________________________________________
Mono-winforms-list maillist - Mono-winforms-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list
More information about the Mono-winforms-list
mailing list