M
Michael
I am attempting to serialize an object using the XmlSerializer, nothing fancy
pretty standard stuff. The object beign serialized has a Collection<t> typed
property as shown below:
public Collection<QueueInstance> ManagedQueues
{
get
{
return this.queuesManaged;
}
}
QueueInstance is a serializable class with only a few string typed
properties defined. However, I am recieving the following error when I
attempt to serialize the parent object (MsmqManager):
Top Level Exception: "There was an error generating the XML document."
Inner Exception: "The type initializer for
'Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterMsmqManager' threw an exception."
Inner Inner Exception: "Object reference not set to an instance of an
object."
The collection is initialized in the constructor of the parent object. The
exception si thrown no matter if there is objects in teh collection or not.
I have found some info online about issues with the XmlSerializer and
generics but nothing that really made any since. I have also attempt to
decorate the property with XmlArray and XmlArrayObject attributes but to no
success. Ideas?
pretty standard stuff. The object beign serialized has a Collection<t> typed
property as shown below:
public Collection<QueueInstance> ManagedQueues
{
get
{
return this.queuesManaged;
}
}
QueueInstance is a serializable class with only a few string typed
properties defined. However, I am recieving the following error when I
attempt to serialize the parent object (MsmqManager):
Top Level Exception: "There was an error generating the XML document."
Inner Exception: "The type initializer for
'Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterMsmqManager' threw an exception."
Inner Inner Exception: "Object reference not set to an instance of an
object."
The collection is initialized in the constructor of the parent object. The
exception si thrown no matter if there is objects in teh collection or not.
I have found some info online about issues with the XmlSerializer and
generics but nothing that really made any since. I have also attempt to
decorate the property with XmlArray and XmlArrayObject attributes but to no
success. Ideas?