[Mono-bugs] [Bug 347228] New: ApplicationSettingsBase does not work when multiple sections are defined in the App .config

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Dec 10 04:23:33 EST 2007


https://bugzilla.novell.com/show_bug.cgi?id=347228


           Summary: ApplicationSettingsBase does not work when multiple
                    sections are defined in the App.config
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: josh+novell at mouch.name
         QAContact: mono-bugs at ximian.com
          Found By: Customer


Description of Problem:
If you try to access settings from App.config using the
System.Configuration.ApplicationSettingsBase model, or in other words, the code
created using the Visual Studio settings code generatation, a null exception
will be thrown if more than one section exists under applicationSettings.  



Steps to reproduce the problem:
1. Create a new console project in VS.
2. Create two new settings files and add a setting to each.
3. In code, try to write the two settings to the console.
4. The exception will be thrown.
5. To get the correct behavior (from the first setting file only), comment out
the second setting's section in applicationSettings in App.Config. 

Actual Results:
The exception below will be thrown.

Expected Results:
The setting value should be returned.


How often does this happen? 
Every time.

Additional Information:

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at System.Configuration.SettingsPropertyValue.get_Name () [0x00000]
  at System.Configuration.SettingsPropertyValueCollection.Add
(System.Configuration.SettingsPropertyValue property) [0x0
0000]
  at System.Configuration.CustomizableFileSettingsProvider.LoadPropertyValue
(System.Configuration.SettingsPropertyColle
ction collection, System.Configuration.SettingElement element, Boolean
allowOverwrite) [0x00000]
  at System.Configuration.CustomizableFileSettingsProvider.LoadProperies
(System.Configuration.ExeConfigurationFileMap e
xeMap, System.Configuration.SettingsPropertyCollection collection,
ConfigurationUserLevel level, System.String sectionGr
oupName, Boolean allowOverwrite) [0x00000]
  at System.Configuration.CustomizableFileSettingsProvider.GetPropertyValues
(System.Configuration.SettingsContext conte
xt, System.Configuration.SettingsPropertyCollection collection) [0x00000]
  at System.Configuration.LocalFileSettingsProvider.GetPropertyValues
(System.Configuration.SettingsContext context, Sys
tem.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]


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list