I have an object that I need to serialize in C#, however this object has the property:
[XmlElement("NodeConfiguration")]
public NodeConfigurationSerialize NodeConfiguration { get; set; }
This property must be ignored during the serialization and must be considered during the deserialization, in other words I need to configure this property in such a way that it is only ignored by the serialization process.
Does anyone know if this is possible? If so, how can I do it?
Note: I am using the Visual Studio 2010 and the .NET Framework 4.0.
I think small change in your design is needed. You need some way to say ‘this isn’t set’:
When you don’t want it set, set it to ‘null’, when you do, you can set it to whatever you want. Now you can automatically use serialization/deserialization without needing to manually edit the files.