E
Ethan Strauss
Hi,
I am using XML serialization for the first time and I have noticed
something unexpected. The object I am serializing contains a field
private NumericSettings _numericSettings;
public NumericSettings NumericSettings
{
get { return _numericSettings; }
}
which is not being serialized, but I would like it to be. When I created a
setter for this field, it was serialized correctly.
private NumericSettings _numericSettings;
public NumericSettings NumericSettings
{
get { return _numericSettings; }
set {_numericSettings = value;}
}
Is this expected behavior? If so, is there a way I force serialization
without creating a setter? I don't want that field to be settable.
Thanks!
Ethan
ps. I am writting in C#.Net 2.0 in a Windows Forms app.
I am using XML serialization for the first time and I have noticed
something unexpected. The object I am serializing contains a field
private NumericSettings _numericSettings;
public NumericSettings NumericSettings
{
get { return _numericSettings; }
}
which is not being serialized, but I would like it to be. When I created a
setter for this field, it was serialized correctly.
private NumericSettings _numericSettings;
public NumericSettings NumericSettings
{
get { return _numericSettings; }
set {_numericSettings = value;}
}
Is this expected behavior? If so, is there a way I force serialization
without creating a setter? I don't want that field to be settable.
Thanks!
Ethan
ps. I am writting in C#.Net 2.0 in a Windows Forms app.