Breaking change docs: CborReader/CborWriter enforce default maximum nesting depth (.NET 11)#54360
Merged
Merged
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
1 task
Contributor
There was a problem hiding this comment.
Pull request overview
Documents a .NET 11 Preview 5 breaking change in System.Formats.Cbor where CborReader and CborWriter now enforce default maximum nesting depths, and explains how to configure higher limits with the new options types.
Changes:
- Adds a new breaking-change article describing previous vs. new max-depth behavior, exceptions thrown, and mitigation via
CborReaderOptions/CborWriterOptions. - Adds the new breaking change to the .NET 11 compatibility index page under Extensions.
- Adds the new article to the compatibility TOC under .NET 11 > Extensions.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docs/core/compatibility/extensions/11/cbor-max-depth.md | New breaking-change article documenting default max depth enforcement and configuration guidance. |
| docs/core/compatibility/11.md | Adds the new breaking change entry to the .NET 11 list under Extensions. |
| docs/core/compatibility/toc.yml | Adds TOC navigation entry for the new .NET 11 Extensions breaking change article. |
gewarren
reviewed
Jun 15, 2026
gewarren
reviewed
Jun 15, 2026
…om:dotnet/docs into copilot/breaking-change-cbor-reader-writer
gewarren
reviewed
Jun 15, 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/core-libraries/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 Core .NET librariesdocs/core/compatibility/toc.yml— adds entry under .NET 11 Core .NET librariesCborReaderandCborWriter, and refines the rationale wording to match repo style guidanceKey callout documented
Unlike
Utf8JsonReader/Utf8JsonWriter,MaxDepth = 0means no nesting allowed (not "use the runtime default"). Users who need deeper nesting must opt in explicitly:You cannot use an AppContext switch to restore the previous unlimited-depth behavior.
Internal previews