BinarySerializationFormatterBinder Property

Gets or sets the SerializationBinder that performs type conversions to and from string.

Definition

Namespace: KGySoft.Serialization.Binary
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public SerializationBinder? Binder { get; set; }

Property Value

SerializationBinder

Implements

IFormatterBinder

Remarks

By default, the binder is not called for natively supported types.

If the ForceRecursiveSerializationOfSupportedTypes flag is set in Options, then the binder is called for the non-primitive natively supported types.

This formatter does not call the binder types that have element types, for constructed generic types and generic parameter types. Instead, the binder is called only for the element types, the generic type definition and the generic arguments separately.

  Note

In .NET Framework 3.5 setting this property has no effect during serialization unless the binder implements the ISerializationBinder interface.

  Tip

If you serialize forwarded types that have no defined forwarding by the TypeForwardedToAttribute and TypeForwardedFromAttribute attributes, then to ensure emitting compatible assembly identities on different .NET platforms use the ForwardedTypesSerializationBinder, define the missing mappings by the AddType method and set its WriteLegacyIdentity property to . Alternatively, you can use the WeakAssemblySerializationBinder or you can just serialize the object without assembly information by setting the OmitAssemblyQualifiedNames flag in the Options.

See Also