Abstract Configuration Element

Sep 12, 2012 at 8:46 PM
Edited Sep 12, 2012 at 8:47 PM

I'm trying to make a configuration section that can be used for queries. Here's what I'm thinking:

<field name="BooleanFieldName">
     <values>
          <booleanValue value="true" />
     </values>
</field>
<field name="IntegerFieldName">
     <values>
          <integerValue value="1" />
          <integerValue value="3" />
     </values>
</field>
<field name="StringFieldName">
     <values>
          <stringValue value="Some Valid String"/>
          <stringValue value="Another Valid String"/>
     </values>
</field>
I saw that there was an Inheritance Modifier property on the Configuration Element, so I created a Configuration Element called "Generic Value" set it to Abstract, and set my BooleanValue, IntegerValue, and StringValue Configuration Elements' Parents to that GenericValue.
However, when I tried to set that GenericValue as the Item Type of the Values Configuration Element Collection, the tool complains that Item Type cannot be Abstract.
What is the purpose of having the ability to make a Configuration Element abstract, if it cannot be used as an Item Type?
Is there another way to get the structure I'm looking for using this tool?
Thanks.
Coordinator
Sep 13, 2012 at 4:42 AM

I believe this is a limitation in Microsoft's configuration implementation. (I haven't verified this.) The reason we have that feature is so that advanced configuration setups where you have elements that have some things in common, and some things not in common, can have those common things in a superclass instead of having to add them multiple times on each of the elements.