tags:

views:

257

answers:

2

Hello guys,

in a XML settings file I am using for console application You have such structure:

...
< appSettings>
        < add key="Message" value="Hello, World!" />
< /appSettings>
...

You access them with ConfigurationSettings.AppSettings["Message"]

I have also large strigs with line breaks etc. (e.g. SQL scripts templates) inside value-attribute. It works great. Also I have a XML template, which I had as separate file. My target is to save all configurable parameters in this app settings file. XML template also. I know, while saving large text inside XML attributes may be passably ok, but saving XML inside XML attributes is crazy.

Is there any way to store all kinds of settings in this file or do I have to deploy separate XMl file?

Thank You!

+1  A: 

You can create your own config section as explained in this post. The article describes customizing web.config sections but it should work exactly the same way for .exe.config.

PanJanek
A: 

As PanJanek allready said, I think the way to do this is to use "custom" config sections.
see this msdn article for more information: http://msdn.microsoft.com/en-us/library/2tw134k3.aspx

Sem Dendoncker