Serialization probem

B

Boni

Dear all,
is it possible to serialize only a base class. I get an exception. What is
wrong?
i.e.
class A :public class B{}

oA=new A
XmlSerializer _serializer=new XmlSerializer( typeof(B));

StreamWriter _sw=null;

try{

_sw=new StreamWriter( filename);

B _ws=oA;

_serializer.Serialize(_sw,_ws);

catch(Exception e){

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top