1
Vote

Serializer not detecting IDictionary<TKey,TValue> Without IDictionary

description

The XML serializer did not correctly determine a custom collection was a Dictionary with just the IDictionary<TKey,TValue> interface implemented. It only looks for the IDictionary interface, and adding IDictionary to my collection made it correctly serialize my collection as a Dictionary instead of (trying to) a Collection of KeyValuePair.

To reproduce: Create a collection that implements IDictionary<TKey,TValue> without implementing IDictionary and attempt to serialize it. It will produce a collection instead of a dictionary in the serialized output.

comments