Repository navigation
fix(devserver): harden host startup against add-in crashes (backport #23649) - #23664
Merged
agneszitte merged 9 commits intoJul 6, 2026
Merged
Conversation
(cherry picked from commit 78bfb7f)
(cherry picked from commit 9a90ed3)
(cherry picked from commit 61d52e0)
(cherry picked from commit 811afd2)
(cherry picked from commit d5197b1)
(cherry picked from commit e951b6b)
Co-authored-by: David <[email protected]> (cherry picked from commit 0050c46)
Co-authored-by: David <[email protected]> (cherry picked from commit 034b563)
(cherry picked from commit 94aabe8)
3 of 5 tasks
agneszitte
approved these changes
Jul 6, 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.
GitHub Issue: unoplatform/uno-private#1968 (parent tracking issue — left open for QA validation and the IDE-extension slices unoplatform/uno.studio#1027 / unoplatform/uno.rider#489)
PR Type:
🐞 Bugfix
What changed? 🚀
On .NET 9-only machines, the DevServer host dies before becoming ready with
FileNotFoundException: System.Text.Encodings.Web, Version=8.0.0.0raised from the licensing client (Kiota) that the Settings add-in registers as a hosted service, and the launcher restarts it in a loop (~40× in the QA logs). The IDE-side dnx→global-tool fallback works; the remaining failure is inside the host process.This PR makes the DevServer resilient to that whole failure class, in three independent layers:
On-demand assembly resolution (
HostAssemblyResolution): theDefault.Resolvingbridge previously only returned already-loaded assemblies, making it load-order dependent (System.Text.Encodings.Webis neither in the host folder nor guaranteed loaded). On a miss the handler now attempts a version-less runtime/TPA load (with a re-entrancy guard) and then probes the registered add-in directories, both behind the same PublicKeyToken / no-downgrade guards as the bridge. Miss diagnostics are emitted only when everything failed, and satellite.resourcesmisses stay silent.Add-in hosted-service quarantine (
AddInHostedServiceQuarantine): add-inIHostedServiceregistrations are wrapped so construction is deferred out of ASP.NET Core's eagerIEnumerable<IHostedService>materialization; constructor/StartAsync failures are logged (with a telemetry eventaddin-hosted-service-quarantined) and disable that service only — the host still becomes ready and Hot Reload keeps working. Faulted add-inBackgroundServiceexecutions are observed instead of stopping the host. The host's own hosted services keep fail-fast behavior.CLI safe-mode retry (
StartCommandHandler): when the spawned host dies before readiness and add-ins were in play, the CLI retries exactly once with--addins ";"— a value every shipped host version interprets as "zero add-ins, skip MSBuild discovery" — turning the silent crash-restart loop into one clearly-logged degraded-mode start that surfaces the captured host stderr.Also fixes a pre-existing structured-logging argument-order bug in
AssemblyHelper.ReportAssemblyRefMismatchesthat printed the version/PKT/name of the mismatch warning shuffled.Validation (all runtime, macOS):
AddInWithFailingHostedServicereproduces the exact crash shape; fail-before/pass-after proven — with quarantine disabled the host dies before ready (QA failure), with it the host reaches ready and still starts the add-in's healthy services.--addins ";"safe-mode sentinel.Note: a clean .NET 9 runtime resolves the 8.0.0.0 request via framework unification in isolation, so the exact environmental trigger on the QA machines is still being pinned down (QA has been asked for
dotnet --info/project.assets.json); the layers above are deliberately trigger-independent. Backport torelease/stable/6.6is planned only after this merges and QA validates. A follow-up in uno.settings to align the Kiota/System.Text.Encodings.Webreferences is tracked separately.PR Checklist ✅
Screenshots Compare Test Runresults.This is an automatic backport of pull request #23649 done by [Mergify](https://mergify.com).