How to XMLSerialze an object which has an object array as filed?

J

Jack

Hi, Could anyone give me some help about the following problem?
I need to XMLSerialize an object of the following class:

[Serializable]
public class FunctionCallingList
{
public string typeName;
public string methodName;
public DateTime time;
public object[] args;
}
And the element of args here could be different(maybe 1 int, 1 doulbe,
1 array and 1 user define type object, which may has another object
arrray inside).

But when I use the following code:
FunctionCallingList = new FunctionCallingList(...);
xmlSerializer = myGetXmlSerializer(typeof(fcl));
xmlSerializer.Serialize(myFuncListWriter, fcl);
it turns out that XMLSerialzer failed because of this object[] args;.
And the element of args here could be different(maybe 1 int, 1 doulbe,
1 array and 1 user define type object).

Could anyone tell me how to handle this issue? Thank you very much.
 

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