This documentation is archived and is not being maintained.

Formatter Class

Provides base functionality for the common language runtime serialization formatters.

The Formatter type is not CLS-compliant. For more information about CLS compliance, see What is the Common Language Specification.

For a list of all members of this type, see Formatter Members.


[Visual Basic]
MustInherit Public Class Formatter
   Implements IFormatter
public abstract class Formatter : IFormatter
public __gc __abstract class Formatter : public IFormatter
abstract class Formatter implements IFormatter

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


Formatter is the abstract (MustInherit in Visual Basic) base class for all runtime serialization formatters, and provides some helper methods for implementing the IFormatter interface. The Formatter also manages queuing objects for serialization and generating IDs on a per-object basis.

Notes to Inheritors:  When you inherit from Formatter, you must override the following members: Serialize, Deserialize, WriteArray, WriteBoolean, WriteByte, WriteChar, WriteDateTime, WriteDecimal, WriteDouble, WriteInt16, WriteInt32, WriteInt64, WriteObjectRef, WriteSByte, WriteSingle, WriteTimeSpan, WriteUInt16, WriteUInt32, WriteUInt64, WriteValueType, SurrogateSelector, Binder, and Context.


Namespace: System.Runtime.Serialization

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Mscorlib (in Mscorlib.dll)

See Also

Formatter Members | System.Runtime.Serialization Namespace | ObjectIDGenerator | XML and SOAP Serialization