DataContractJsonSerializer.MaxItemsInObjectGraph Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the maximum number of items in an object graph that the serializer serializes or deserializes in one read or write call.
public:
property int MaxItemsInObjectGraph { int get(); };
public int MaxItemsInObjectGraph { get; }
member this.MaxItemsInObjectGraph : int
Public ReadOnly Property MaxItemsInObjectGraph As Integer
The maximum number of items to serialize or deserialize.
The number of items exceeds the maximum value.
This property can be set using a constructor. For a list, see DataContractJsonSerializer.
The MaxItemsInObjectGraph property specifies the maximum number of objects that the serializer serializes or deserializes in a single ReadObject or WriteObject method call. The method always reads one root object, but this object may have other objects in its data members. Those objects may have other objects. The default is MaxValue. Note that when serializing or deserializing arrays, every array entry counts as a separate object. Also, note that some objects may have a large memory representation, so this quota alone may not be sufficient to prevent Denial of Service attacks. For more information, see Security Considerations for Data. If you need to increase this quota beyond its default value, it is important to do so both on the sending (serializing) and receiving (deserializing) sides. It applies both when reading and writing data.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: