Basic serialization question.

B

BFlaherty_2003

I have a basic serialization app. I am able to serialize my struct
with varying level of success. The problem that I am seeing is that
when any of the values in my class (see below) are not assigned values,
there is no XML generated for this field. For example, if I only
assign a value to NumberOfItems, only the NumberOfItems element will be
serialized. Why is this? For my app, I would like to have empty
elements when there is no value assigned. Any idea as to how I can do
this?

Thanks,
BF

[Serializable]
public struct ConsoleData
{
public int NumberOfItems;
public string NameOfGroup;
public string Test1;
public string Test2;
}
 

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