Menu
  • HOME
  • TAGS

User config section with a list

c#,custom-configuration

As far as I see, there is no way to let ResourceGroup inherit from ConfigurationSection and ConfigurationElementCollection, which means you'll have to add an additional node that keeps the <item>'s together: <resources> <items> <item title="A" details="aaaaaa" /> <item title="b" details="bbbbbbb" /> <item title="c" details="ccccc" /> <item title="d" details="ddddd" /> </items>...

Several custom configuration in #if directive

c#,visual-studio,custom-configuration

Yes. Quoting the #if documentation on MSDN: You can use the operators && (and), || (or), and ! (not) to evaluate whether multiple symbols have been defined. You can also group symbols and operators with parentheses. ...

Weird error while accessing an element in a ConfigurationElementCollection

c#,asp.net,configurationsection,custom-configuration,configurationelement

Changing GetElementKey to: protected override object GetElementKey(ConfigurationElement element) { return ((MetadataConfig)element).Name; } Allows the following to return: TestTitle Console.WriteLine(serviceConfigSection.SampleConfig.MetaData["title"].Value); ...