I have a base class that inherits from CollectionBase that stores a
group of objects that inherit from an interface (let's call it
IEntity). The default item[] property and Add() method both handle
IEntity types, and I implement this interface on several objects. When
trying to serialize it I get a serialization error ("cannot serialize
interface IEntity") when I try to return a class that contains a
property that uses the collection type.
I tried shadowing the item[] member to return a class type rather than
an interface type, but no luck.

I'm starting to loose the rest of my hair ;-)

Thanks in advance,

Josselin

Re: XML Serialization - Interface by S

S
Tue Sep 06 07:32:21 CDT 2005

Does IEntity have the Serializable attribute?

Regards
Senthil


Re: XML Serialization - Interface by joss

joss
Tue Sep 06 07:41:39 CDT 2005

nope, this is an interface public the class inheriting it is.


Re: XML Serialization - Interface by joss

joss
Tue Sep 06 07:42:35 CDT 2005

nope. I wouldn't think that is related.
This is an inteface, the class inheriting is is declared as
Serializable.