FormatterTypeStyle Enumeration

Indicates the format in which type descriptions are laid out in the serialized stream.

Namespace:  System.Runtime.Serialization.Formatters
Assembly:  mscorlib (in mscorlib.dll)

[SerializableAttribute]
[ComVisibleAttribute(true)]
public enum FormatterTypeStyle

Member nameDescription
TypesAlwaysIndicates that types can be given to all object members and ISerializable object members.
TypesWhenNeededIndicates that types can be stated only for arrays of objects, object members of type Object, and ISerializable non-primitive value types.
XsdStringIndicates that strings can be given in the XSD format rather than SOAP. No string IDs are transmitted.

The XsdString and TypesWhenNeeded settings are meant for high performance serialization between services built on the same version of the .NET Framework. These two values do not support VTS (Version Tolerant Serialization) because they intentionally omit type information that VTS uses to skip or add optional fields and properties. You should not use the XsdString or TypesWhenNeeded type formats when serializing and deserializing types on a computer running a different version of the .NET Framework than the computer on which the type was serialized. Serializing and deserializing on computers running different versions of the .NET Framework causes the formatter to skip serialization of type information, thus making it impossible for the deserializer to skip optional fields if they are not present in certain types that may exist in the other version of the .NET Framework. If you must use XsdString or TypesWhenNeeded in such a scenario, you must provide custom serialization for types that have changed from one version of the .NET Framework to the other.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft