471,318 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,318 software developers and data experts.

Collection Xml Serialization

Hey all

I've developed a couple of strongly-typed collections and marked them as
[Serializable], however when I attempt to serialize instances of the
collection I recieve the following exception:

"You must implement the Add(System.Object) method on
PrecisionObjects.Collections.Specialized.StringDic tionaryEx because it
inherits from IEnumerable."

Short of implementing the IXmlSerializable interface, which is intended for
internal use of the .NET Framework, is there a way I can get Xml
Serialization to work?

Implementing the Add(System.Object) method as below:

public void Add(object value)
if(value is DictionaryEntry)
DictionaryEntry entry = (DictionaryEntry) value;

if(entry.Key is string && entry.Value is string)
this.Add(entry.Key as string, entry.Value as string);

Still produced the same exception...

Thanks in advance

Doug Holland
Jul 21 '05 #1
0 1011

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Craig Schneider | last post: by
1 post views Thread by Brian Orrell | last post: by
2 posts views Thread by Greg | last post: by
1 post views Thread by Carl Gilbert | last post: by
16 posts views Thread by Ben Hannon | last post: by
4 posts views Thread by Michael Rich | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.