Serialization Problem

C

Curious

Hi,

I am trying to use the following code to make xml serialization to a
file. The following error is being given:

"An unhandled exception of type 'System.InvalidOperationException'
occurred in system.xml.dll

Additional information: There was an error generating the XML
document."

The problem should be due to inheritance.

Can someone help me solve the problem out.
Thanks in Advance



ICommunicationTuple ict = new MessageQueueCommunication("test");
XmlSerializer ser = new XmlSerializer(typeof(ICommunicationTuple));
StreamWriter writer = new StreamWriter("c:\\test.xml");
ser.Serialize(writer, cu);
writer.Close();

public abstract class ICommunicationTuple
{
public ICommunicationTuple(){}
}

public class MessageQueueCommunication : ICommunicationTuple
{
private string msgQueuePath;

public MessageQueueCommunication(){}

public MessageQueueCommunication(string messageQueuePath)
{
MessageQueuePath = messageQueuePath;
}


public string MessageQueuePath
{
set { msgQueuePath = value;}
get { return msgQueuePath; }
}
}
 

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