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; }
}
}
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; }
}
}