ConfigurationSection question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a custom Configuration Section that will have this kind
of an xml representation

<CustomSection>
<Objects>
<Object type="sometype">
<Property name="someproperty" anotherAttribute="somevalue"/>
<Property name="someproperty" anotherAttribute="secondvalue"/>
</Object>
<Object type="sometype">
<Property name="someproperty" anotherAttribute="somevalue"/>
<Property name="someproperty" anotherAttribute="secondvalue"/>
</Object>
</Objects>
</CustomSection>

The problem that I am having is that I am not able to create the "Property"
level collection, everything else is getting created and written out, but the
Property elements are not being rendered out to the config file.
If anyone has ever ran across this type of issue, any help would be greatly
appriciated.

Thanks,

Ilya
 
Ilya

I'm not sure I understand your problem. Configuration Sections are part of
the application configuration and as such are readonly. Does your question
relate writing a handler to read this section? If not, can you provide some
source code?

Cheers

Kevin
 
My apologies, I think I understand what you mean. A bit of source code would
still be useful though.

Kevin
 
My blog projects...
http://spaces.msn.com/sholliday/ 12/1/2006 and
2/8/2006 entries

both have custom configuration handlers.

Perhaps they can help. There is downloadable code you can quickly step
thru.


Make sure you put the break point INSIDE the handler. Again, put a
breakpoint INSIDE the handler.

As a "step into" won't work within the handler..... as its microsoft code
that calls the it.
 
Thanks to all who have responded.

I was able to resolve the problem that I was having, I think it had to do
with the way I was trying to implement the Configuration Elements. I created
a base class that other configuration elements would inherit from so I could
provide some basic functionaity, but I think that I coded it incorrectly when
it came time to use the Configuration Element classes inside the
ElementCollection to retrieve the key and that is why the objects were not
serializing properly.

Thanks again.

Ilya
 
Back
Top