Is there a way to use a dictionary or xml in the Application Settings?
Posted
by Shimmy
on Stack Overflow
See other posts from Stack Overflow
or by Shimmy
Published on 2010-04-18T20:33:18Z
Indexed on
2010/04/19
23:33 UTC
Read the original article
Hit count: 195
I have to store a complex type in the application settings. I thought that storing it as XML would work best.
The problem is I don't know how store XML. I prefer to store it as a managed XML rather than using just a string of raw XML having to parse it on each access. I managed to set the Type
column of the setting to XDocument, but I was unable to set its value.
Is there a way to use XDocument or XML in application settings?
Update
I found a way, simply by editing the .settings file with the xml editor.
I changed it to a custom serializable dictionary, but I get the following error when I try to access the setting-property (I set it to a serialized representation of the default value).
The property 'Setting' could not be created from it's default value.
Error message: There is an error in XML document (1, 41).
Any ideas will be appreciated.
© Stack Overflow or respective owner