Skip to content

Potential Issues with Deserializing ISerializable Types #1414

@shmao

Description

@shmao

There's a couple of potential issues with deserializing ISerializable types,

  1. An ISerializable type's OnDeserializing callback is not called on the actual deserialized object.
  2. The object added to XmlObjectSerializerReadContext is not the actual deserialized, which may cause wrong behavior in "IsReference=true" scenarios.

The issues occur with both ILGen based and reflection only based serialization. To investigate the issue, we need to look into the following methods,

ReflectionReader.ReflectionReadClass
XmlFormatReaderGeneratorCriticalHelper.GenerateClassReader
JsonFormatReaderGenerator.CriticalHelper.GenerateClassReader

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Serializationhelp wanted[up-for-grabs] Good issue for external contributorsuntriagedNew issue has not been triaged by the area owner

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions