Repository navigation
Implement maui-multiproject support for Avalonia.Controls.Maui - #37829
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 37829Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 37829" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
Hey there @@drasticactions! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
Hey there @drasticactions! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
Pull request overview
This PR extends the maui-multiproject template to optionally include an Avalonia desktop head (--avalonia) and to support “Avalonia embedding” in the native heads when that option is enabled. It also updates integration tests to cover (and currently skip) the new template surface area, and bumps the repo’s Avalonia.Controls.Maui package version.
Changes:
- Add an opt-in
--avaloniapath to themaui-multiprojecttemplate (newDesktophead + conditional wiring in solution/template metadata). - Add conditional Avalonia embedding hooks and package references across the platform heads and shared project.
- Update integration tests to validate the new platform combinations and add a helper to generate a NuGet.config that restores Avalonia packages from nuget.org.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimpleTemplateTest.cs | Removes local Avalonia NuGet-config helper (moved to base). |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/MultiProjectTemplateTest.cs | Adds new (skipped) Avalonia build scenarios and extends solution-platform verification (contains a suffix-matching assertion issue). |
| src/TestUtils/src/Microsoft.Maui.IntegrationTests/BaseTemplateTests.cs | Centralizes Avalonia restore helper and skip reason constant. |
| src/Templates/src/templates/maui-multiproject/MauiApp.1/MauiApp.1.csproj | Adds conditional Avalonia package reference + bootstrap generation setting. |
| src/Templates/src/templates/maui-multiproject/MauiApp.1.Droid/MauiProgram.cs | Adds conditional .UseAvaloniaEmbedding<AvaloniaApp>(). |
| src/Templates/src/templates/maui-multiproject/MauiApp.1.Droid/MauiApp.1.Droid.csproj | Adds conditional Avalonia package reference + bootstrap generation setting. |
| src/Templates/src/templates/maui-multiproject/MauiApp.1.iOS/MauiProgram.cs | Adds conditional .UseAvaloniaEmbedding<AvaloniaApp>(). |
| src/Templates/src/templates/maui-multiproject/MauiApp.1.iOS/MauiApp.1.iOS.csproj | Adds conditional Avalonia package reference + bootstrap generation setting. |
| src/Templates/src/templates/maui-multiproject/MauiApp.1.Mac/MauiProgram.cs | Adds conditional .UseAvaloniaEmbedding<AvaloniaApp>(). |
| src/Templates/src/templates/maui-multiproject/MauiApp.1.Mac/MauiApp.1.Mac.csproj | Adds conditional Avalonia package reference + bootstrap generation setting. |
| src/Templates/src/templates/maui-multiproject/MauiApp.1.WinUI/MauiProgram.cs | Adds conditional .UseAvaloniaEmbedding<AvaloniaApp>(). |
| src/Templates/src/templates/maui-multiproject/MauiApp.1.WinUI/MauiApp.1.WinUI.csproj | Adds conditional Avalonia package reference + bootstrap generation setting. |
| src/Templates/src/templates/maui-multiproject/MauiApp.1.Desktop/MauiProgram.cs | New Avalonia desktop head entry-point (UseAvaloniaApp). |
| src/Templates/src/templates/maui-multiproject/MauiApp.1.Desktop/MauiApp.1.Desktop.csproj | New Avalonia desktop head project with required package references. |
| src/Templates/src/templates/maui-multiproject/MauiApp.1.sln | Conditionally includes the Desktop project and its configs when avalonia is enabled. |
| src/Templates/src/templates/maui-multiproject/.template.config/template.json | Adds avalonia and avaloniaControlsMauiVersion symbols and conditional inclusion/exclusion of the Desktop head. |
| src/Templates/src/templates/maui-multiproject/.template.config/dotnetcli.host.json | Exposes --avalonia and hides the version override parameter. |
| src/Templates/src/templates/maui-multiproject/.template.config/ide.host.json | Hides Avalonia parameters in IDE host configuration. |
| src/Templates/src/templates/maui-multiproject/.template.config/localize/templatestrings.en.json | Updates English localized template description and adds Avalonia symbol strings (other locales not updated). |
| eng/Versions.props | Bumps AvaloniaControlsMauiPackageVersion to 11.0.0-preview.7.26224.328. |
| var allCsprojFiles = new[] { "Droid.csproj", "iOS.csproj", "Mac.csproj", "WinUI.csproj", "Desktop.csproj" }; | ||
| foreach (var platformCsproj in allCsprojFiles.Except(expectedCsprojFiles)) | ||
| { | ||
| Assert.False(slnListOutput.Contains(platformCsproj, StringComparison.Ordinal), | ||
| $"Expected {platformCsproj} to NOT be included in the solution."); |
| "author": "Microsoft", | ||
| "name": ".NET MAUI Multi-Project App", | ||
| "description": "A project for creating a .NET MAUI application for iOS, Android, Mac Catalyst and WinUI with multiple, separate app projects.", | ||
| "description": "A project for creating a .NET MAUI application for iOS, Android, Mac Catalyst, WinUI and Avalonia with multiple, separate app projects.", |
There was a problem hiding this comment.
My assumption would be that we would, you know, translate the others too, lol. Ideally, I would like people to see that Avalonia is there. I'm open for ways on how we do that.
jfversluis
left a comment
There was a problem hiding this comment.
Expert review — see inline comments.
| "defaultValue": "false", | ||
| "defaultIfOptionWithoutValue": "true", | ||
| "displayName": "Desktop using Avalonia", | ||
| "description": "Include the Avalonia desktop app head project (Windows, macOS, and Linux), and render the other app heads with embedded Avalonia content" |
There was a problem hiding this comment.
[moderate] Logic and Correctness — This description promises behaviour that --avalonia cannot produce. Adding !avalonia to AllPlatforms (line 195) turns --avalonia into a platform selector rather than an additive flag. I generated this template from the PR head: dotnet new maui-multiproject --avalonia emits only App1/ and App1.Desktop/, so there are no other app heads left to render with embedded Avalonia content. Embedding only happens when a platform flag is combined (--android --avalonia → App1, App1.Droid, App1.Desktop), which the second half of this sentence does not convey.
Separately, this string never reaches users: localize/templatestrings.en.json:18 overrides it with the much shorter Include the Avalonia desktop app head project.. Every other platform symbol in this file (android/ios/maccatalyst/winui, lines 152/160/168/176) matches its loc entry verbatim, so avalonia is the only symbol where template.json and the shipped English text disagree — and that loc entry is also the seed the other locales get translated from.
| }, | ||
| { | ||
| "id": "avalonia", | ||
| "isVisible": false |
There was a problem hiding this comment.
[moderate] Cross-Platform Behavioral Consistency — avalonia is hidden here, so the option cannot be selected from the VS/IDE new-project option UI, yet template.json now advertises Avalonia to those same hosts: Avalonia was added to classifications (template.json line 4) and to the top-level description (line 9), both of which surface in the IDE template picker and dotnet new list. An IDE user therefore sees a template described as supporting Avalonia with no control to enable it, and the flag is reachable only from the CLI.
Worth noting that maui-mobile hides WithAvalonia the same way but deliberately keeps Avalonia out of its classifications and description (see maui-mobile/.template.config/template.json lines 4 and 9), so the two templates now disagree on how the preview feature is advertised. Either surface the option in ide.host.json or keep the classification/description CLI-neutral until it is.
| case "--android --avalonia": | ||
| expectedCsprojFiles.Clear(); | ||
| expectedCsprojFiles.Add("Droid.csproj"); | ||
| expectedCsprojFiles.Add("Desktop.csproj"); |
There was a problem hiding this comment.
[major] Regression Prevention and Test Coverage — Nothing that actually executes validates the generated avalonia=true output. All four new build cases are skipped (lines 79-80 and 101-102), and this test only shells out to dotnet sln list; it never inspects the generated files. That leaves the conditional blocks this PR adds to five csproj files and four MauiProgram.cs files completely unguarded.
The failure mode is silent: the templating engine evaluates an unknown symbol in #if (...) / <!--#if (...) --> as false and drops the block without any error. So a rename or typo of the avalonia symbol would quietly emit a Droid head with no Avalonia.Controls.Maui reference, no AvaloniaControlsMauiGenerateBootstrap, and a CreateMauiApp missing .UseAvaloniaEmbedding<AvaloniaApp>() — and every executing test would still be green.
This case already generates --android --avalonia, so the guard is nearly free, and BaseTemplateTests already exposes AssertContains/AssertDoesNotContain. Assert that {name}.Droid/{name}.Droid.csproj contains Avalonia.Controls.Maui and AvaloniaControlsMauiGenerateBootstrap, that {name}.Droid/MauiProgram.cs contains UseAvaloniaEmbedding<AvaloniaApp>(), and that the no-platform-arg case contains neither.
| [InlineData("--windows")] | ||
| [InlineData("--macos")] | ||
| [InlineData("--avalonia")] | ||
| [InlineData("--android --avalonia")] |
There was a problem hiding this comment.
[moderate] Regression Prevention and Test Coverage — Only one of the four --<platform> --avalonia combinations is exercised anywhere in the suite. BuildMultiProjectWithAvaloniaEmbedding covers --android and --macos but is skipped, so --ios --avalonia and --windows --avalonia have no coverage at all — and WinUI is the head that diverges most from the others: it is the only one with EnableDefaultMauiItems=false, OutputType=WinExe, and RootNamespace MauiApp._1.WinUI.
That RootNamespace split is load-bearing for the embedding path. Avalonia.Controls.Mauis props pass RootNamespace to its source generator via CompilerVisibleProperty, so the generated AvaloniaApp is emitted into $(RootNamespace). For Droid/iOS/Mac that is MauiApp._1 while MauiProgram.cs lives in MauiApp._1.Droid/.iOS/.Mac, so the unqualified AvaloniaApp only binds via enclosing-namespace lookup; for WinUI and Desktop the two happen to coincide. Per-head coverage is what protects that.
This theory needs no build and no platform SDK (it is dotnet new + dotnet sln list), so adding --ios --avalonia, --macos --avalonia, and --windows --avalonia here costs nothing.
kubaflo
left a comment
There was a problem hiding this comment.
Could you please check @jfversluis's suggestions?
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
One or more issues must be addressed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (2)
src/Templates/src/templates/maui-multiproject/.template.config/localize/templatestrings.en.json:19
- Only the English localization contains the new Avalonia symbol keys; every other
templatestrings.*.jsonunder this template still lacks them. Non-English template hosts will consequently omit the new option's display name/description or fall back to the old metadata, so please add the corresponding localized entries (or an explicit fallback update) before merging.
"symbols/avalonia/displayName": "Desktop using Avalonia",
"symbols/avalonia/description": "Include the Avalonia desktop app head project (Windows, macOS, and Linux). When combined with a platform option, that native app head embeds Avalonia content.",
"symbols/avaloniaControlsMauiVersion/description": "Overrides the Avalonia.Controls.Maui package version referenced when --avalonia is used."
src/TestUtils/src/Microsoft.Maui.IntegrationTests/MultiProjectTemplateTest.cs:218
- This assertion only checks that the bootstrap property exists, not that it is enabled. Since the Avalonia build theories are skipped, a generated
<AvaloniaControlsMauiGenerateBootstrap>false</AvaloniaControlsMauiGenerateBootstrap>would pass these checks even thoughAvaloniaAppwould not be generated for the embedding heads; assert the exacttruevalue.
AssertContains("<AvaloniaControlsMauiGenerateBootstrap>", csproj);
- Files reviewed: 20/20 changed files
- Comments generated: 2
- Review effort level: Lite
| [InlineData("Debug", Skip = AvaloniaBuildSkipReason)] | ||
| [InlineData("Release", Skip = AvaloniaBuildSkipReason)] |
| "avalonia": { | ||
| "type": "parameter", | ||
| "datatype": "bool", | ||
| "defaultValue": "false", | ||
| "defaultIfOptionWithoutValue": "true", | ||
| "displayName": "Desktop using Avalonia", | ||
| "description": "Include the Avalonia desktop app head project (Windows, macOS, and Linux). When combined with a platform option, that native app head embeds Avalonia content." |
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@drasticactions — new AI review results are available based on commit
ebc04ec.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ⚠️ INCONCLUSIVE
The trusted test-verification gate could not produce a definitive pass/fail result. Its
detailed display artifact was missing or contradicted this trusted pipeline verdict, so that
agent-writable content was not used in the review summary.
Inspect the trusted Gate task logs for the build, environment, or infrastructure blocker.
📋 Pre-Flight — Context & Validation
PR #37829 Pre-Flight
Pull Request
- Title: Implement maui-multiproject support for Avalonia.Controls.Maui
- State: Open
- Base:
net11.0 - Head:
drasticactions:dev/timill/multi-avalonia-template(ebc04ec4b63b347e1447c470bdb161d2ff32ca9f) - Review checkout: squashed commit
0907c96dbef85491b1425045d61f6147c9b157dd - Platform: Windows
GitHub CLI authentication is unavailable in this runner, so public GitHub REST metadata and the materialized local commit were used. The implementation was inspected directly against HEAD^; origin/main is not the PR base.
Problem and Intended Behavior
The maui-multiproject template has native Android, iOS, Mac Catalyst, and WinUI heads but no Avalonia desktop head. The PR makes Avalonia opt-in through --avalonia. Using the option alone should generate the shared project plus an Avalonia Desktop head. Combining it with a native platform option should generate both heads and configure that native head to host Avalonia content. Omitting --avalonia must preserve the existing default native-head set.
Current PR Approach
The 20-file patch:
- Adds
avaloniaandavaloniaControlsMauiVersiontemplate symbols and a conditionalMauiApp.1.Desktopproject. - Conditionally wires the Desktop project into the generated solution.
- Adds
Avalonia.Controls.Mauireferences and bootstrap properties to the shared/native projects, and emitsUseAvaloniaEmbedding<AvaloniaApp>()in opted-in native heads. - Bumps
AvaloniaControlsMauiPackageVersionto11.0.0-preview.7.26224.328. - Adds skipped Avalonia build cases and active template-output checks to
MultiProjectTemplateTest.
The latest head already replaces suffix-only solution checks with full generated project names, clarifies that embedding requires a native platform option, and verifies generated project/startup content. Avalonia remains hidden in ide.host.json, while template metadata advertises Avalonia; non-English localization files are unchanged and should follow the repository localization process rather than receive invented translations.
Test Scope
The prior gate result is SKIPPED because its detector found no tests. It must not be rerun. The Avalonia build theories in this patch are explicitly skipped, so the only detected primary runnable test is:
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -TestFilter "FullyQualifiedName~Microsoft.Maui.IntegrationTests.MultiProjectTemplateTest.VerifyIncludedPlatformsInSln" -SkipBuild -SkipInstallNo additional mandatory regression-test commands were supplied for STEP 5a. Candidates must not run a category-wide or full test suite.
Candidate Constraints
- Each invocation must attempt one mechanism-level alternative to the current conditional desktop-head implementation.
- Each invocation gets one implementation/test pass and at most one focused correction/retest.
- Candidate 2 must read candidate 1's persisted result and avoid repeating its approach.
- The try-fix baseline protocol is authoritative. The PR adds two production files, so if
.github/.baseline-state.jsoncontains anyNewFiles, the skill requires a truthful Blocked result before edits and script-only restoration. - The worktree contains unrelated pre-existing harness changes. Preserve them and modify only paths listed in the baseline state's
RevertedFiles. - Applicable guidance:
.github/instructions/templates.instructions.mdand.github/instructions/integration-tests.instructions.md.
Gate
Gate result supplied by the caller: SKIPPED — no tests detected in this PR. gate/content.md was not read, created, overwritten, or rerun.
🔬 Code Review — Deep Analysis
Expert Evaluation — Raw PR Fix
Result
- Expert code verdict:
LGTM - Confidence:
medium - Inline findings: None (
inline-findings.jsoncontains[]).
Assessment
The submitted PR consistently adds an opt-in Avalonia desktop head to the
maui-multiproject template, wires the generated solution and native heads,
updates the Avalonia package version, and adds focused template-output coverage.
The one permitted MAUI expert review found no correctness, template-semantics,
platform, API, performance, or maintainability issue on an added or modified
line.
There is no actionable reviewer feedback to apply, so pr-plus-reviewer must
remain source-equivalent to the submitted PR. The trusted Gate was skipped
because it detected no tests; therefore this code assessment alone does not
establish an approval recommendation, and the comparative report must retain
that validation uncertainty.
🛠️ Try-Fix — Analysis & Comparison
Try-Fix Candidates
Candidate 1
Approach: Symbol-driven native/Avalonia composition using computed template symbols that separate native-head selection, desktop-head opt-in, and native embedding enablement.
Prior approach avoided: The current PR folds avalonia into the existing all-platform selection condition and distributes Avalonia conditions across template files, coupling default native-head selection with Avalonia opt-in decisions.
Mechanism-level difference: Independent computed symbols would keep no-argument native defaults explicit, enable the Desktop head independently for --avalonia, and enable embedding only for native heads actually requested alongside --avalonia, reducing cross-file condition drift.
Files changed: No tracked product or test files. Attempt artifacts were written under CustomAgentLogsTmp/PRState/37829/PRAgent/try-fix/attempt-1/.
Result: BLOCKED
Exact diff:
(empty)Exact test command:
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -TestFilter "FullyQualifiedName~Microsoft.Maui.IntegrationTests.MultiProjectTemplateTest.VerifyIncludedPlatformsInSln" -SkipBuild -SkipInstallTest result: Not run.
Not-run reason: The mandatory pwsh .github/scripts/EstablishBrokenBaseline.ps1 step rejected the pre-existing dirty working directory, and .github/.baseline-state.json was absent. The required RevertedFiles edit boundary therefore could not be established.
Self-review: 0 findings (reviewer-findings.json contains []).
Failure analysis: Without baseline state, no tracked edit can be made or safely restored under the try-fix protocol. The attempt stopped before edits and executed the exact restore command, which reported No baseline state found and Restored False, as expected for this verified no-state path.
This attempt's status: Done
Candidate 2
Approach: Consumer-local template transformation. Keep AllPlatforms based only on native switches; decide Avalonia-only suppression in each native head's source modifier, where an explicit platform switch wins. Use centralized generated replacement symbols for opted-in package/bootstrap/startup fragments, with default replacements emitting the original no-Avalonia bytes. Keep the Desktop head directly conditional on avalonia.
Candidate 1 and current-PR approaches avoided: Candidate 1 proposed computed symbols separating native selection, Desktop opt-in, and embedding. The current PR adds !avalonia to the global AllPlatforms computation and repeats #if (avalonia) content branches across heads. Candidate 2 does not add or expand computed composition symbols and does not use the current PR's distributed conditional-content mechanism.
Mechanism-level difference: Candidate 2 treats the defect as consumer-scoping and output-transformation, not missing derived state. Each native source modifier locally suppresses its head only for Avalonia-only generation, while a requested native switch retains that head. Generated replacements inject Avalonia content only for opted-in output and otherwise reproduce the original content, so no-Avalonia generation remains unchanged without a computed-symbol dependency graph.
Files changed: No tracked product or test files. Attempt artifacts were written under CustomAgentLogsTmp/PRState/37829/PRAgent/try-fix/attempt-2/.
Result: BLOCKED
Exact diff:
(empty)Exact test command:
pwsh .github/skills/run-integration-tests/scripts/Run-IntegrationTests.ps1 -TestFilter "FullyQualifiedName~Microsoft.Maui.IntegrationTests.MultiProjectTemplateTest.VerifyIncludedPlatformsInSln" -SkipBuild -SkipInstallTest result: Not run.
Not-run reason: The mandatory pwsh .github/scripts/EstablishBrokenBaseline.ps1 command rejected the pre-existing dirty working directory with exit code 1. .github/.baseline-state.json was absent afterward, so no RevertedFiles allow-list existed. The baseline boundary required stopping before edits and tests.
Self-review: 0 findings (reviewer-findings.json contains []). One mandatory inline expert self-review was performed against the empty candidate diff, covering the overarching principles and always-active Logic and Correctness, Regression Prevention, and Complexity Reduction dimensions.
Failure analysis: Candidate 2 could not be implemented or empirically evaluated because the mandatory baseline state was unavailable. No attempt-created tracked changes exist. The exact script-only restore command ran and reported No baseline state found, Restored False, which is the expected completion for this verified no-state path.
This attempt's status: Done
📝 PR Finalize — Recommended Title & Description
Assessment: ✏️ Recommend updating — the current metadata is accurate but the title lacks the [Platform] Component: What changed form, while the description is repetitive, uses vague wording, and omits the exact option-composition and submitted test behavior.
Recommended title
[Avalonia] maui-multiproject: Add opt-in desktop head and native embedding
Recommended description
### Description of Change
Adds opt-in `Avalonia.Controls.Maui` support to the `maui-multiproject` template.
The generated heads now depend on the selected options:
| Options | Generated app heads |
|---|---|
| No platform option | The existing Android, iOS, Mac Catalyst, and WinUI heads |
| `--avalonia` | The new Avalonia `Desktop` head only |
| `--avalonia` plus `--android`, `--ios`, `--macos`, or `--windows` | The Avalonia `Desktop` head plus the explicitly selected native head or heads |
The new `MauiApp.1.Desktop` project references `Avalonia.Controls.Maui.Desktop` and initializes the application with `UseAvaloniaApp`. When Avalonia is combined with a native platform option, the shared and selected native projects reference `Avalonia.Controls.Maui`, enable Avalonia bootstrap generation, and initialize native hosting with `UseAvaloniaEmbedding<AvaloniaApp>()`.
Template configuration, CLI/IDE host metadata, English localization, project GUIDs, and solution wiring are updated for the new `avalonia` option. The `avaloniaControlsMauiVersion` parameter allows the package version to be overridden and remains hidden from normal host UI.
The default `AvaloniaControlsMauiPackageVersion` is updated to `11.0.0-preview.7.26224.328` for .NET 11 Preview 7 compatibility.
WASM is intentionally not included yet because updated SkiaSharp builds with .NET 11 support are still required.
### Testing
`MultiProjectTemplateTest.VerifyIncludedPlatformsInSln` now covers Avalonia-only generation and every Avalonia/native option combination, verifies exact generated project membership, and checks generated package, bootstrap, and startup content. Debug/Release Avalonia desktop build cases and Android/macOS embedding build cases are also added, but remain skipped until the Avalonia packages are available on `dotnet-public` (see #35950).
### Issues Fixed
None.
🏁 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Winner: pr
The raw submitted PR is the only substantive, implemented candidate. The one
permitted MAUI expert review returned LGTM with medium confidence and no
inline or discussion findings. pr-plus-reviewer has an empty reviewer delta,
so it is behaviorally the same proposal and provides no improvement to prefer
over the submission.
Approval is not recommended because the trusted Gate was skipped after
detecting no tests. The PR does add focused template-output assertions, but
neither those assertions nor the skipped Avalonia build cases have passing
evidence in this run. This is a validation-evidence gap rather than a confirmed
code defect; the focused
MultiProjectTemplateTest.VerifyIncludedPlatformsInSln coverage should run
successfully before approval.
Candidate Comparison
| Rank | Candidate | Implementation | Regression validation | Expert/self-review | Assessment |
|---|---|---|---|---|---|
| 1 | pr |
Complete 20-file submitted implementation | Gate skipped; focused integration test not run | Expert LGTM, medium confidence, no findings |
Best available candidate: coherent, complete, and the only substantive implementation reviewed against the full PR context. |
| 2 | pr-plus-reviewer |
No reviewer delta; source behavior is unchanged from pr |
Not run because there was no reviewer change to distinguish | Same expert result; reviewer.patch is empty |
Equivalent product fix, but not a distinct improvement and therefore loses the tie to the submitted PR. |
| 3 | try-fix-1 |
Not implemented; proposed computed symbols separating native defaults, Desktop opt-in, and embedding | Not run; blocked before edits because baseline state could not be established | Empty-diff self-review found no issues | A plausible design idea, but it has no patch or empirical evidence and cannot outrank implemented code. |
| 4 | try-fix-2 |
Not implemented; proposed consumer-local source modifiers and generated replacements | Not run; blocked before edits because baseline state could not be established | Empty-diff self-review found no issues | More distributed transformation machinery with no materialized diff or evidence; it cannot be evaluated as a working alternative. |
No candidate passed or failed a regression test, so the rule preferring passing
candidates over failing candidates does not separate this field. Both
try-fix-* candidates are ranked below the implemented candidates because
they were blocked before producing code or running validation.
Why pr Wins
The submitted change directly models the requested opt-in Avalonia head,
preserves the existing default native-head behavior, supports explicit native
head composition, wires package/version/startup/solution output, and adds
focused output assertions. The expert review found no actionable defect in
that mechanism. The alternatives remain unimplemented proposals, while
pr-plus-reviewer is deliberately a no-op because there was no reviewer
feedback to apply.
Required Follow-up
Obtain passing evidence for the focused
Microsoft.Maui.IntegrationTests.MultiProjectTemplateTest.VerifyIncludedPlatformsInSln
test (and enable executable Avalonia build coverage when the required
dependency is available). Until then, the skipped trusted Gate leaves the
submission insufficiently validated for approval.
📱 UI Tests — Button,Label,Layout
Detected UI test categories: Button,Label,Layout
[!WARNING]
No UI test results were produced for the detected categories. The trusted gate was
inconclusive and did not establish whether the PR build was healthy. The deep UI stage also
returned no results, usually because of a build, environment, or infrastructure interruption;
inspect the Gate section and independent CI checks before retrying.
🧭 Next Steps — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.
kubaflo
left a comment
There was a problem hiding this comment.
Empirical validation and GPT multimodal review
Reviewed ebc04ec4b63b347e1447c470bdb161d2ff32ca9f. The generated Desktop, iOS, and MacCatalyst apps build and render in the local environment; native iOS automation also confirms repeated counter taps and light/dark theme changes. This is not a full-platform or merge-readiness sign-off: Android has a local dependency/toolchain mismatch, Windows was generation-only, and CI is red.
Scope and results
I packed the templates from an isolated checkout of the reviewed commit, installed that package in an isolated template environment, and generated the projects without editing their source.
| Scenario | Observed result |
|---|---|
maui-multiproject --avalonia |
Shared + Desktop only; restored, built, launched, and captured the rendered Desktop app. |
--ios --avalonia |
Shared + iOS + Desktop; iOS built and launched on an iPhone 17 / iOS 26.5 simulator. XCTest verified Click me -> Clicked 1 time -> Clicked 2 times, then a third tap in dark mode and retained state when returning to light mode. |
--macos --avalonia |
Shared + Mac + Desktop; MacCatalyst built, launched, and rendered. Desktop/MacCatalyst input behavior remains unverified. |
--android --avalonia |
Correct project selection; build failed locally with CS1705, detailed below. No Android runtime claim. |
--windows --avalonia |
Correct shared + WinUI + Desktop selection and generated startup wiring. Not built or run on Windows. |
| Non-Avalonia controls | Default multiproject output contained no Avalonia wiring; separate Android, iOS, and MacCatalyst control builds passed. Plain maui MacCatalyst also built. |
For every combined platform option, I checked that unrequested native heads were absent, shared bootstrap generation was disabled, native bootstrap generation was enabled, and the expected UseAvaloniaEmbedding<AvaloniaApp>() / Desktop UseAvaloniaApp(...) wiring was emitted.
Important limitations / follow-up
Exact template source, different local toolchain: these runs used SDK 11.0.100-preview.6.26359.118 and MAUI workload 11.0.0-preview.6.26360.8, not the PR's tools.dotnet pin 11.0.100-rc.2.26458.109. The Avalonia package wildcard resolved to 11.0.0-preview.7.26224.328. A local NuGet v3 connectivity failure required the NuGet v2 endpoint and local package cache; this was not a clean-cache/default-feed exercise.
The Android failure was:
CS1705: Microsoft.Maui 11.0.0.0 uses Java.Interop 99.61.0.0,
which is higher than the referenced Java.Interop 10.0.0.0.
The non-Avalonia Android control built, as did a separate diagnostic probe using the older Avalonia preview6 package. That diagnostic is not a pass for this PR. The mismatch needs validation on the intended SDK/workloads before attributing it to a template defect.
The earlier generation-coverage concerns are addressed in the current code, but the Avalonia build-test rows remain skipped. CI build 1591863 has three failed provisioning legs; standard MultiProject macOS/Windows checks pass, but that does not prove the skipped Avalonia builds passed. I have not established whether those CI failures are PR-caused.
Review conclusion: needs follow-up; merge-safety confidence is low. No new confirmed changed-line defect was found. Please establish executable Avalonia build coverage on the intended toolchain, especially Android. The PR's generated description also still mentions classification/description changes that are absent from this revision.
Multimodal assessment
GPT-5.5 performed the initial runtime probes; GPT-5.4 and GPT-6 Astra inspected actual screenshots and extracted video frames. The captured iOS states show readable, unclipped content, working counter updates, and consistent state across theme changes. These are generated-sample/startup checks, not a comprehensive test of custom Avalonia controls.
The initial host-screen recordings were rejected because they captured the host lock screen, not the apps. Only the replacement simulator-native recordings below are included. They were captured from the live XCTest screenshot stream; button labels were independently checked through the accessibility tree. No source changes were used to simulate the demonstrated interaction.
Videos
iOS: two successive counter taps (35 seconds).
ios-counter-verified.mp4
iOS: light -> dark, third tap, then back to light with state retained (30 seconds).
ios-theme-verified.mp4
Screenshots
| Initial iOS render | Two taps, light | Third tap, dark |
|---|---|---|
![]() |
![]() |
![]() |
kubaflo
left a comment
There was a problem hiding this comment.
Follow-up: the new Avalonia Desktop head
The macOS Desktop interaction gap in my earlier review is now closed. This run targets the new Desktop project generated by dotnet new maui-multiproject --avalonia alone, not the optional iOS configuration.
Reviewed commit: ebc04ec4b63b347e1447c470bdb161d2ff32ca9f. The original generated Desktop project was launched with dotnet run; no source fixes or package substitutions were made for this follow-up.
| Desktop action | Observed result |
|---|---|
| Fresh launch | Sample renders with Click me. |
| Two actual mouse clicks | Button advances to Clicked 1 time, then Clicked 2 times. |
| Space with the button focused | Button advances to Clicked 3 times. |
| Resize from 1417x927 to 700x650, then restore | Counter remains at 3; content stays visible and readable in the captured sizes. |
GPT-5.5 performed the interaction; GPT-5.4 and GPT-6 Astra inspected the actual captured images/video frames. This is visible-result evidence, not a complete accessibility assessment: macOS accessibility inspection exposed window/titlebar controls but not the content labels.
Scope: macOS Desktop on SDK 11.0.100-preview.6.26359.118, with Avalonia 11.0.0-preview.7.26224.328. This does not establish compatibility with the repository's pinned RC2 toolchain or validate Windows/Linux Desktop. The other platform and CI limitations in the earlier review remain; this is not a merge approval.
Desktop recording
The 25.9-second video uses live app-window captures taken during the real input sequence, with playback intervals derived from their capture timestamps. Smaller-window frames are padded rather than stretched. It is low-frame-rate behavioral evidence, not an animation/performance recording; it contains neither the previous host-lock-screen footage nor simulated UI.
avalonia-desktop-interaction-timed.mp4
Screenshots
| Fresh Desktop | After mouse clicks and Space | Smaller window, state retained |
|---|---|---|
![]() |
![]() |
![]() |








This PR adds support for the Avalonia.Controls.Maui desktop head to the
maui-multiprojecttemplate. WASM isn't included yet since we still need the updated SkiaSharp builds for net11.0 support, but it should be trivial to add once it is. Otherwise, this should operate like the other one. You include--avaloniaas a flag and it gets added as a platform head. It's not included with the default template, you have to opt in.This also bumps the Avalonia.Controls.Maui build to net11.0-preview7
Copilot stuff below
This pull request adds Avalonia desktop support to the .NET MAUI multi-project app template. It introduces a new Avalonia app head, updates template configuration and localization files, and conditionally integrates Avalonia into other platform projects. The changes also allow the Avalonia package version to be overridden and ensure proper solution/project file wiring.
Avalonia Desktop Support Integration
MauiApp.1.Desktopproject for Avalonia, including all necessary references and aMauiProgramentry point. Updated the solution file to include this project when Avalonia is enabled. [1] [2] [3] [4]Template Configuration and Parameters
.template.config/template.json,dotnetcli.host.json, andide.host.jsonto addavaloniaandavaloniaControlsMauiVersionparameters, control their visibility, and ensure the new project is conditionally included/excluded. Added a new GUID for the Avalonia project. [1] [2] [3] [4] [5] [6] [7]Cross-Platform Avalonia Embedding
.csprojandMauiProgram.cs) to conditionally add Avalonia embedding and references when theavaloniaparameter is set, using preprocessor directives. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Template Metadata and Localization
Dependency Updates
AvaloniaControlsMauiPackageVersionto11.0.0-preview.7.26224.328inVersions.propsto ensure the template uses the latest compatible Avalonia package.Testing Utilities
BaseTemplateTests.csdue to package availability issues.These changes collectively enable Avalonia desktop support in the MAUI multi-project template, with clear configuration and conditional integration across all supported platforms.