first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

Web Service Exception: "The type System.Collections.Hashtable is not supported because it implements IDictionary."; System.NotSupportedException

Over two years ago, Dare Obasanjo explained to us why an ASMX exception can occur when a type implements IDictionary. In "XML Serialization in the .NET Framework" Dare writes, "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." The rest of this article, as of this writing, is here:

http://msdn.microsoft.com/library/en-us/dnexxml/html/xml01202003.asp

Using the [NonSerialized()] attribute to hide members that cannot be serialized does not appear to avoid this problem.

mod date: 2005-02-14T05:07:58.000Z