.net 2.0 configuration section.

  • Thread starter Thread starter Ashish
  • Start date Start date
A

Ashish

hi All,

I am trying to define a section in a .net 2.0 configuration file. Turns
out that i "have" to define a type with it.
and i dont really want to create a seperate class for holding this
information so i make it of type System.Configuration.DefaultSection ...

DefaultSection exposes a property of type SectionInformation and when i
use the SectionInformation.GetRawXML() method, i get an error "This
operation does not apply at runtime."

The code is like
DefaultSection p
=(DefaultSection)ConfigurationManager.GetSection("mySection");

p.SectionInformation.GetRawXml()

any help would be appreciated !

TIA
 
Why don't you use appSettings?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
 
Iam now :), but would still be curious as to why i cannot do what i was
tryin to,
one thing for sure that the configuration API is much higher level than 1.1
 
Well, I created my own custom classes for custom Configuration Settings.
That is what I would recommend, other than using appSettings.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
 
Back
Top