Skip to content

Avoid StackOverflowException when there are graph cycles in serialization #29129

@steveharter

Description

@steveharter

During serialization if there is a cycle in the object graph, a StackOverflowException is raised. Instead we should throw an InvalidOperationException or other exception TBD. StackOverflowException is non-recoverable.

To avoid this, we should use the MaxDepth setting. Note this setting is used during deserialization (where we throw a InvalidOperationException) but it currently is not used for serialization.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions