[Mono-bugs] [Bug 399364] New: reduce extra configuration instance initialization

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jun 11 13:36:04 EDT 2008


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


           Summary: reduce extra configuration instance initialization
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: P5 - None
         Component: Configuration
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: atsushi at ximian.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


The following example prints the count of initialized instance of TestSection.
It hence shows that we do some extra initialization of configuration:

---- test.cs ----
using System;
using System.Configuration;

public class TestSection : ConfigurationSection
{
        static int x;
        ConfigurationProperty foo;
        public TestSection ()
        {
                Console.WriteLine (x++);
                foo = new ConfigurationProperty ("foo", typeof (string));
                Properties.Add (foo);
        }
        [ConfigurationProperty ("foo")]
        public string Foo {
                get { return (string) base [foo]; }
                set { base [foo] = value; }
        }
}

public class Test
{
        public static void Main ()
        {
                TestSection t = (TestSection) ConfigurationManager
                        .GetSection ("test");
                Console.WriteLine (t.Foo);
        }
}

---- test.exe.config ----

<configuration>
  <configSections>
    <section name="test" type="TestSection,test" />
  </configSections>
  <test foo="bar" />
</configuration>

Actual result:
0
1
2
3
bar

Expected result:
0
1
bar


-- 
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