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: [email protected]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
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.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs