I have an object with a property implemented like
public String Bla {get;set;}
After changing the implementation to something lik
Try implementing ISerializable
[SecurityCritical]
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException("info");
info.AddValue("name of compiler generated field", _bla);
}
The BinaryFormatter
serializes the fields, not the properties.
You could possibly get it to work by seeing what the auto-generated field name was in ILSpy or something similar and naming yours that way.
Otherwise as stated by Henrik you would have to write your own deserialization, see this question for more information
You can probably inspect the deserialization info by implementing ISerializable
and special case this field.