Re: multiple same section in app.config



Droopy,

Well, it will, but you have to have one root element that is not
repeated.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"Droopy" <droopytoonnospam@xxxxxxxxxxx> wrote in message
news:Xns983F6268796C5droopytoonnospamhotm@xxxxxxxxxxxxxxxxx
My problem is that I tried to use the same section multiple times.
A custom section won't help I suppose ?

Droopy <droopytoonnospam@xxxxxxxxxxx> wrote in
news:Xns983F5AE6BAF74droopytoonnospamhotm@xxxxxxxxxxxxxx:

That is a good idea but I don't really like it.
The parsing seems a bit too complicated.
I am going to try my own custom handler.

Thanks.

"Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
wrote
in news:eJJHISB2GHA.4116@xxxxxxxxxxxxxxxxxxxx:

Droopy,

The reason this doesn't work is that you are trying to create
something
of a heiarchical nature for data that is simply a set of pairs.

If you want to use the NameValueSectionHandler, then you need to
do
something like this:

<Connections>
<add key="ComPort_1" value="COM2" />
<add key="Name_1" value="Connection 1" />
<add key="ComPort_2" value="COM4" />
<add key="Name_2" value="Connection 2" />
</Connections>

Then, you would have to parse the names to see how the values are
grouped together.

If you want to have a different kind of config setup, then you
will have
to create your own custom handler.

Hope this helps.







.



Relevant Pages

  • Re: ASF custom file type
    ... This source filter is loaded when playing the AVI. ... stock AVI/WAV handler or custom handler ...
    (microsoft.public.win32.programmer.directx.video)
  • Encrypt custom web.config section / cannot load custom handler?
    ... I am attempting to encrypt a custom section of my web.config. ... I've confirmed that the custom handler works in a web application. ... Could not load file or assembly 'MyCustomHandler' or one of its ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: multiple same section in app.config
    ... Droopy wrote in ... The parsing seems a bit too complicated. ... I am going to try my own custom handler. ...
    (microsoft.public.dotnet.languages.csharp)