Repository navigation
Upgrade to .NET 10.0 (from .NET 8.0) - #249
Merged
Merged
Conversation
.NET 8 reaches end-of-support in November 2026. Bumps TargetFramework to net10.0 across the core library, tests, all CLI tools (redline, docx2html, docx2oc, docxodus-pyhost), the diffharness tool, and the WASM bridge; global.json now pins SDK 10.0.0. CI workflows (ci.yml, playwright.yml, publish.yml, python-publish.yml) provision the .NET 10 SDK. The upgrade itself was almost entirely mechanical: the library, tests, CLI tools, and WASM/AOT toolchain all built cleanly on the first pass, and the full xUnit suite matches the .NET 8 baseline exactly (2468 passed, 0 failed, 3 skipped). One real regression surfaced in the npm WASM bridge: the .NET 10 WASM runtime hangs indefinitely when initialized inside a dedicated Web Worker that has already registered a message handler via the `self.onmessage =` property form (dotnet/runtime#114918, a regression from .NET 8's runtime). docxodus.worker.ts hit this exactly, since it assigns its handler that way before init. Fixed by switching to `self.addEventListener("message", ...)`, which doesn't set the `onmessage` property and avoids the runtime's buggy worker-environment detection. Verified against a byte-for-byte .NET 8 vs .NET 10 WASM bundle comparison: .NET 8 initialized a worker in ~485ms, the unpatched .NET 10 build hung indefinitely, and the patched build initializes in ~520ms. Full Playwright suite (231 tests, including the four worker-prepare.spec.ts tests and worker.spec.ts that exercise this path) now passes end-to-end. Also updates scripts/build-wasm.sh and the Python host's dev-fallback path for the new net10.0 output directory, and refreshes .NET-version references in CLAUDE.md/README.md/python/README.md and the CHANGELOG.
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.
Summary
.NET 8 reaches end-of-support in November 2026, so this upgrades the whole stack to .NET 10.0:
TargetFrameworkbumped tonet10.0across the core library, tests, all CLI tools (redline/docx2html/docx2oc/docxodus-pyhost), thediffharnesstool, and the WASM bridge (wasm/DocxodusWasm).global.jsonnow pins SDK10.0.0.ci.yml,playwright.yml,publish.yml,python-publish.yml) now provision the .NET 10 SDK.scripts/build-wasm.shand the Python host's dev-fallback discovery path updated for the newnet10.0output directory..NET-version references refreshed inCLAUDE.md,README.md,python/README.md, andCHANGELOG.md.The TFM bump itself was almost entirely mechanical — the library, tests, CLI tools, and WASM/AOT toolchain all built cleanly on the first pass with zero source changes, and the full xUnit suite matches the .NET 8 baseline exactly.
A real regression found and fixed
One genuine bug surfaced during the upgrade, isolated to the npm WASM bridge's Web Worker path: the .NET 10 WASM runtime hangs indefinitely when initialized inside a dedicated Worker that has already registered a message handler via the
self.onmessage = ...property form. This is an upstream, open regression from .NET 8 (dotnet/runtime#114918) —dotnet.js's asset loader mis-detects the worker environment and never resolves its asset-loading promises, sodotnet.create()/getAssemblyExports()hang with no error.npm/src/docxodus.worker.tsregistered its handler withself.onmessage = ...before calling into WASM init, hitting this exactly. Fixed by switching toself.addEventListener("message", ...), which doesn't set theonmessageproperty and sidesteps the bug — behavior is otherwise identical.Verified with a byte-for-byte .NET 8 vs .NET 10 WASM bundle comparison in an isolated worktree: the .NET 8 build initialized a Worker in ~485ms, the unpatched .NET 10 build hung indefinitely (60s timeout), and the patched .NET 10 build initializes in ~520ms.
Test plan
dotnet build Docxodus.sln -c Release— 0 warnings, 0 errors (library, tests, all CLI tools, WASM bridge)dotnet test Docxodus.Tests/Docxodus.Tests.csproj -c Release— 2468 passed, 0 failed, 3 skipped — identical to the .NET 8 baseline run in the same environmentscripts/build-wasm.sh— WASM/AOT publish succeeds end-to-end on the .NET 10 emscripten toolchaincd npm && npm run build && npx tsc --noEmit— cleancd npm && npm test(Playwright, 231 tests across 36 spec files) — 231 passed, including the fourworker-prepare.spec.tstests andworker.spec.ts's worker-lifecycle tests that exercise the fixed code pathGenerated by Claude Code