This documentation is archived and is not being maintained.

DataContractSerializerOperationBehavior Class

Represents the run-time behavior of the DataContractSerializer.

Namespace:  System.ServiceModel.Description
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public class DataContractSerializerOperationBehavior implements IOperationBehavior, IWsdlExportExtension

The DataContractSerializerOperationBehavior enables control of DataContractSerializer options, such as the MaxItemsInObjectGraph and IgnoreExtensionDataObject properties. Some properties can only be set using the constructor of the class. In that case, the DataContractSerializer can be replaced using the CreateSerializer method. For more information about data contracts, see Using Data Contracts.

For more information about using the DataContractSerializerOperationBehavior to replace the IDataContractSurrogate returned by the DataContractSurrogate property, see Data Contract Surrogates.

The following example finds the DataContractSerializerOperationBehavior in the collection of behavior for an operation and resets the MaxItemsInObjectGraph and IgnoreExtensionDataObject properties.

No code example is currently available or this language may not be supported.


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

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 3.5, 3.0