Draft
Conversation
- Add virtual async methods (ReadAsync, ReadFirstChildAsync, ReadNextSiblingAsync, SkipAsync) to OpenXmlReader base class, guarded by FEATURE_ASYNC_SAX_XML - Add Async property to OpenXmlPartReaderOptions (FEATURE_ASYNC_SAX_XML only) - Update OpenXmlPartReader.CreateReader to accept OpenXmlPartReaderOptions and pass Async to XmlReaderSettings - Add async override implementations in OpenXmlPartReader using XmlReader.ReadAsync, SkipAsync, MoveToContentAsync - Add ReadAsync, SkipAsync, MoveToContentAsync overrides in XmlConvertingReader to delegate to BaseReader - Update PublicAPI unshipped files for netstandard2.0, net6.0, net8.0, net10.0 - Add OpenXmlReaderAsyncTest with 13 async tests covering both OpenXmlPartReader and OpenXmlDomReader scenarios Agent-Logs-Url: https://github.com/dotnet/Open-XML-SDK/sessions/1107ecf6-458c-498d-b45c-f7b3d6eeb5fc Co-authored-by: twsouthwick <[email protected]>
Copilot
AI
changed the title
[WIP] Add async XmlReader methods for OpenXmlReader
Add async methods to OpenXmlReader
Apr 28, 2026
Collaborator
|
@copilot fix the build errors from the previous build |
…ts in test file Agent-Logs-Url: https://github.com/dotnet/Open-XML-SDK/sessions/6f63d95d-60c0-4875-bf32-d65922638da7 Co-authored-by: mikeebowen <[email protected]>
Contributor
Author
Collaborator
|
@copilot refactor the tests to use using statements |
Agent-Logs-Url: https://github.com/dotnet/Open-XML-SDK/sessions/9f7dafae-f19c-4860-9edb-b30d991726ef Co-authored-by: mikeebowen <[email protected]>
Contributor
Author
Collaborator
|
@copilot refactor FEATURE_ASYNC_SAX_XML to be TASKS_SUPPORTED |
Agent-Logs-Url: https://github.com/dotnet/Open-XML-SDK/sessions/b4206f2b-8af0-42de-91b1-11dbdb2a70a2 Co-authored-by: mikeebowen <[email protected]>
Contributor
Author
Done in 7aa9cc0. Renamed |
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.
OpenXmlReaderhad no async API despiteOpenXmlWriterhaving full async support. This adds parity by introducingReadAsync,ReadFirstChildAsync,ReadNextSiblingAsync, andSkipAsync.Changes
OpenXmlReader(base class) — virtual async methods that fall back to their sync counterparts (same pattern asOpenXmlWriter); guarded by#if TASKS_SUPPORTEDso net35/net40 are unaffectedOpenXmlPartReaderOptions— newAsyncproperty (mirrorsOpenXmlPartWriterSettings.Async); propagated throughUpdateForPartand forwarded toXmlReaderSettings.AsyncOpenXmlPartReader— truly async overrides backed byXmlReader.ReadAsync/SkipAsync/MoveToContentAsync; private async helpers mirror the existing syncMoveToNextElement/MoveToFirstChild/InnerSkip/ReadRootlogicXmlConvertingReader— overridesReadAsync,SkipAsync,MoveToContentAsyncto delegate toBaseReader(the wrapper would otherwise fall through to the throwing baseXmlReaderdefault)netstandard2.0,net6.0,net8.0,net10.0Usage
OpenXmlDomReaderworks with the same async API via the base-class fallbacks (noAsyncflag required).