Breaking change docs: CborReader/CborWriter enforce default maximum nesting depth (.NET 11)#54360
Draft
Copilot wants to merge 3 commits into
Draft
Breaking change docs: CborReader/CborWriter enforce default maximum nesting depth (.NET 11)#54360Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
…ult maximum nesting depth
Copilot
AI
changed the title
[WIP] Enforce maximum nesting depth for CborReader and CborWriter
Breaking change docs: CborReader/CborWriter enforce default maximum nesting depth (.NET 11)
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents the .NET 11 Preview 5 breaking change where
CborReaderandCborWriternow enforce maximum nesting depths by default (64 and 1000, respectively), throwingCborContentExceptionandInvalidOperationExceptionwhen exceeded.Changes
docs/core/compatibility/extensions/11/cbor-max-depth.md— covers previous/new behavior, affected APIs, and how to configure a higher limit via the newCborReaderOptions/CborWriterOptionstypesdocs/core/compatibility/11.md— adds entry under Extensionsdocs/core/compatibility/toc.yml— adds entry under .NET 11 ExtensionsKey callout documented
Unlike
Utf8JsonReader/Utf8JsonWriter,MaxDepth = 0means no nesting allowed (not "use the runtime default"). Users who need deeper nesting must opt in explicitly:There is no AppContext switch to restore unlimited-depth behavior.