.net 2.0 configuration section.

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
 
K

Kevin Spencer

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.
 
A

Ashish

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
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top