Groups | Blog | Home
all groups > dotnet xml > december 2005 >

dotnet xml : Serialization Problem


Curious
12/3/2005 8:20:06 AM
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; }
}
}
Eckhard Schwabe
12/4/2005 2:06:05 PM
Hello,

[quoted text, click to view]

This seems exactly like the error described in
http://msdn.microsoft.com/XML/BuildingXML/XMLinNETFramework/default.aspx?pull=/library/en-us/dnxmlnet/html/trblshtxsd.asp
and there are some solutions to this problem in this link.

AddThis Social Bookmark Button