473,499 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.net 2.0 configuration section.

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


Dec 13 '05 #1
3 1781
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.

"Ashish" <as*****@thisisjunk.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
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

Dec 13 '05 #2
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

Kevin Spencer wrote:
Why don't you use appSettings?

Dec 13 '05 #3
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.

"Ashish" <as*****@thisisjunk.com> wrote in message
news:eD***************@TK2MSFTNGP14.phx.gbl...
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

Kevin Spencer wrote:
Why don't you use appSettings?

Dec 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1537
by: Famille Delorme | last post by:
Sorry if this discussion are already submited, but I don't find anything really interresting for me. And sorry for my bad english, it is not my native language. I wrote a program in Python for a...
1
2733
by: serge calderara | last post by:
dear all, I have problem accessing section group in my configuration application file. I got an error saying thta I can have only one section ???? here is my application configuration looks...
3
1886
by: Robert | last post by:
I have an application with custom configuration sections in it's app.config file. Here's a shortened excerpt: <monitors> <monitor...
0
5296
by: phillip | last post by:
This is interesting, I have attached my web.config file and the exception I have been logging. I created a library which provide data access to a database and a control system. The library is...
1
2833
by: Ramanfromoz | last post by:
Hi, Developing a new we application. Everything okay on my local WIN XP PROFESSIONAL, IIS 5.0 running locally. The website is running smoothly. Now, the same code I am copying over to a...
5
4571
by: Water Cooler v2 | last post by:
I know that we can add a single name value entry in app.config or web.config in the configuration/configSettings/appSettings section like so: <add key="key" value="value" /> Question: I want...
1
6408
by: Jess Chadwick | last post by:
I am attempting to use the Enterprise Library (Jan 2006) Cryptography block to encrypt a credit card number in my ASP.NET 2.0 Commerce Server application. Everything is configured correctly, as...
4
1905
by: Michael Lang | last post by:
I was basically wanting to know how to use the System.Configuration namespace to be able to load an arbitrary number of unknown attributes on an element in a custom section in the .config into a...
6
4783
by: Jeff Hegedus | last post by:
I have a dll that requires some configuration data. I put the configuration data in a custom configuration section in a config file that is loaded in the installation folder of the dll. If I...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7012
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5479
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4605
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3105
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3101
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
307
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.