Lost
Lost

Reputation: 13565

Storing complex objects in web.config

I am basically wanting to fetch an IDIctionary from a place which is global setting repository. We basically use IOC and I had put it there but for certain reasons , it has to be moved to web.config. I have gone through some articles and the nearest I got was this:

http://brijbhushan.net/2011/04/21/how-to-store-custom-objects-in-web-config/

Again this article talks about storing it programmatically. I just want something simple where a programmer can come at the design time and store or change my dictionary and that's it. Any idea on how to achieve this?

Upvotes: 0

Views: 1173

Answers (1)

Jason De Oliveira
Jason De Oliveira

Reputation: 1742

The web.config file is not really a good place to store and deserialize objects from. I would recommend using XAML files for this purpose. This is much more appropriate and done by MS themselves. You can get more information here http://blogs.microsoft.co.il/blogs/bursteg/archive/2009/05/18/xaml-in-net-4-0-serialization-and-deserialization-using-xamlservices.aspx.

Upvotes: 3

Related Questions