[Mono-bugs] [Bug 353554] New: Constructor of TypeConverter-derived class must be public under Mono for it to be used in ConfigurationSection conversions

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Jan 13 22:48:47 EST 2008


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


           Summary: Constructor of TypeConverter-derived class must be
                    public under Mono for it to be used in
                    ConfigurationSection conversions
           Product: Mono: Class Libraries
           Version: 1.2.5
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Configuration
        AssignedTo: toshok at novell.com
        ReportedBy: rcook at opiumtrail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development


Created an attachment (id=190381)
 --> (https://bugzilla.novell.com/attachment.cgi?id=190381)
Repro sources

The attached repro shows a simple class derived from ConfigurationSection which
exposes a property marked with a TypeConverterAttribute instance defining a
custom type conversion to perform when reading the property's value from the
program's configuration file.

Run under Mono this program throws the following exception:

Unhandled Exception: System.MissingMethodException: Method not found: 'Default
constructor not found...ctor() of Trac102.MyPropertyConverter'.
  at System.Activator.CreateInstance (System.Type type, Boolean nonPublic)
[0x00000] 
  at System.Activator.CreateInstance (System.Type type) [0x00000] 
  at System.Configuration.ElementMap..ctor (System.Type t) [0x00000] 
  at System.Configuration.ElementMap.GetMap (System.Type t) [0x00000] 
  at System.Configuration.ConfigurationElement.get_Properties () [0x00000] 
  at System.Configuration.ElementInformation..ctor
(System.Configuration.ConfigurationElement owner,
System.Configuration.PropertyInformation propertyInfo) [0x00000] 
  at System.Configuration.ConfigurationElement.get_ElementInformation ()
[0x00000] 
  at System.Configuration.ConfigurationElement.Reset
(System.Configuration.ConfigurationElement parentElement) [0x00000] 
  at System.Configuration.Configuration.GetSectionInstance
(System.Configuration.SectionInfo config, Boolean createDefaultInstance)
[0x00000] 
  at System.Configuration.Configuration.GetSectionInstance
(System.Configuration.SectionInfo config, Boolean createDefaultInstance)
[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.Configuration.GetSection (System.String path)
[0x00000] 
  at
System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection
(System.String configKey) [0x00000] 
  at System.Configuration.ConfigurationManager.GetSection (System.String
sectionName) [0x00000] 
  at Trac102.Program.Main (System.String[] args) [0x00000] 

If I make the constructor public then the program runs as expected generating
the output "my-property = correct".

Under the CLR this program will work with an internal constructor.


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


More information about the mono-bugs mailing list