First off I'm not sure why XMLSerialize can't handle interfaces.  Isn't this
kind of a bad restriction on a language that only has single inheritance and
relies heavily on interfaces!????
 
Here is my question.  I have a barcode class that looks like this:

public class Barcode : Control, IComponent
{
}

When I try to xmlserialize it I get this error:
 
System.NotSupportedException: Cannot serialize member
System.ComponentModel.Component.Site of type System.ComponentModel.ISite
because it is an interface.

If I override System.ComponentModel.Component.Site and tell Serialization to
ignore it, it doesn't help. In fact if I comment out the IComponent from the
class declaration it still compiles but with the same results.

This tells me that anything that implements IComponent or Inherits from
Control can not be xml serialized?  Surely I'm missing something here.  Is
there an easy way around this or am I going to have to jump through a bunch
of hoops to do a simple xml serialization?

Thanks for your help as always,
Brian

Reply via email to