Click here to Skip to main content
14,970,162 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi

Does any one knows , how to serialize IDictionary Object (of string,Object) to XML ?
Posted

1 solution

You'd have to do it yourself, it isn't implemented by default.

See this page[^], specifically:

Quote:
Q: Why can't I serialize hashtables?

A: The XmlSerializer cannot process classes implementing the IDictionary interface. This was partly due to schedule constraints and partly due to the fact that a hashtable does not have a counterpart in the XSD type system. The only solution is to implement a custom hashtable that does not implement the IDictionary interface.
   
Comments
Sergey Alexandrovich Kryukov 28-Mar-13 18:17pm
   
Good point, a 5.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900