Saving an Object to application settings

In the application settings file (properties/Settings.settings) you can specify different types for the setting. I wanted to save an object as an user setting but I could not get to work. Finally after an hour or so of gooleing I found the solution. You have to set in what way the object is serialized. To do that open Settings.Designer.cs (expand Settings.settings to see it) and add the following line in front of the property that you want to control the serialization on:


And bang! It all works (as long as you have a serializable file that is). You could also choose Xml or String (the default)

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>