Skip to content

Fix the four build breaks on main (RS1038, CS0260, IL2121, Essentials Windows CS0117) - #40666

Merged
kubaflo merged 8 commits into
mainfrom
simonrozsival-fix-main-ci-build-breaks
Nov 27, 2026
Merged

kubaflo merged 8 commits into
mainfrom
simonrozsival-fix-main-ci-build-breaks

Conversation

@simonrozsival

@simonrozsival simonrozsival commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Target Branch

This PR is for Initial base
New features, API changes, or .NET 12 work (including .NET 12 fixes) main
.NET 11 servicing fixes net11, for review
Older servicing, release integration, infrastructure, or documentation The branch designated for that work

For .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into net11; agents must not retarget or merge.

Description of Change

Every main build is currently red (for example maui-pr 1701052, maui-pr-uitests 1701137 and maui-pr-devicetests 1701071 at f38825f), and every PR inherits the failures. There's one commit per break:

  1. RS1038 fails every UI test leg.

    Caused by: Bump Microsoft.CodeAnalysis.Analyzers from 3.3.4 to 5.12.0 #40641 (c507118, merged 2026-11-26), which bumped Microsoft.CodeAnalysis.Analyzers in UITest.Analyzers.csproj. Seen in maui-pr-uitests 1701137.

    That Dependabot bump of Microsoft.CodeAnalysis.Analyzers from 3.3.4 to 5.12.0 brought in RS1038, which 3.3.4 didn't report. RS1038 flags an analyzer whose assembly also references Microsoft.CodeAnalysis.Workspaces. UITest.Analyzers has done that since its two IDE-only code fix providers were added with the analyzer in [tests] Analyzer / code fix provider for UITest [Test] without [Category] #23287 (July 2024), so the code didn't change; the rule is new. CI builds the UI test projects in Release, where the warning is an error, so every UI test leg fails before any test runs. Windows Debug builds only report a warning.

    The command-line compiler only loads the analyzer type, never the code fixes, so this PR suppresses RS1038 for this test-only project. A follow-up will move the code fixes into their own assembly so the suppression can be removed.

  2. CS0260 in the Windows TestCases.HostApp build.

    Caused by: Generate QueryProperty setters for trimming and NativeAOT #40387 (ed7a64a, merged 2026-11-26), which changed _17521CatDetailsPage and _33356CatDetailsPage to public partial class in Issues/Issue17521.cs and Issues/Issue33356.cs. Seen in maui-pr 1701052 (Build Windows).

    The nested [QueryProperty] pages in Issue17521 and Issue33356 were made partial, but their containing Shell types weren't.

    • Windows build failure: the error doesn't come from the MAUI generator. The pinned WindowsSdkPackageVersion 10.0.19041.44 bundles CsWinRT 2.1.2. Its WinRTAotSourceGenerator emits a partial declaration of the containing type for every nested partial class that implements INotifyPropertyChanged, and all pages do. CsWinRT fixed this in Fix IsPartial check and escaping of assembly name microsoft/CsWinRT#1802, so the newer projections in current SDKs don't do it. I reproduced the failure with a scratch project.
    • Runtime failure on every platform: the MAUI QueryPropertyGenerator skips types whose containers aren't partial. It reports MAUI1200 only when the trim analyzer is enabled. Navigating to these pages then throws InvalidOperationException on every platform. This was hidden because the UI tests couldn't build.

    This PR makes both containers partial. It also makes ShellSearchControlPage.SearchDetailPage partial: it has [QueryProperty] and fails at runtime the same way.

  3. IL2121 in RunOniOS_MauiReleaseTrimFull_CoreCLR.

    Caused by: Generate QueryProperty setters for trimming and NativeAOT #40387 (ed7a64a, merged 2026-11-26), which added src/Controls/src/Core/Shell/QueryPropertyConversion.cs with these IL2026 suppressions. Seen in maui-pr 1701052 (log 1304).

    No call in QueryPropertyConversion.ApplyLegacyQueryProperties or ValidateGeneratedQueryProperties requires unreferenced code, so their IL2026 suppressions are unused.

    • ILLink only adds NoWarn IL2121 when PublishTrimmed is already true at evaluation. iOS trimmed builds therefore surface it.
    • The template app only reaches ApplyLegacyQueryProperties. Only generated code calls ValidateGeneratedQueryProperties, so any app that uses [QueryProperty] would hit the same IL2121 there.

    This PR removes both IL2026 suppressions. The IL2067 and IL2072 suppressions are still used.

  4. Essentials Windows device-test build.

    Caused by: [net12][Graphics/Essentials] Add image metadata APIs and non-destructive MediaPicker processing #36581 (c6fe1d8, merged 2026-11-25), which deleted src/Essentials/src/MediaPicker/ImageProcessor.windows.cs, including RotateImageAsync, without updating Tests/Windows/ImageProcessor_Tests.cs. maui-pr-devicetests 1699822 (just before it) built; 1699985 (the first build including it) failed.

    That PR replaced the Windows ImageProcessor.RotateImageAsync with the shared Graphics-based ImageProcessor, which broke the build with CS0117. The WMC0001: Unknown type 'MiddleApp' that follows is a cascade: the XAML compiler can't resolve the project's own C# types after the C# pre-compile fails. The build was green before [net12][Graphics/Essentials] Add image metadata APIs and non-destructive MediaPicker processing #36581.

    The Issue38570 test now calls ProcessImageToCacheFileAsync with the options MediaPicker uses for RotateImage = true. It still checks the following:

    • the output codec chosen from the file name;
    • stored pixels rotated exactly once;
    • preserved metadata that doesn't rotate them again (oriented and stored dimensions are equal).

    The unchanged-stream assertion for orientation 1 is gone because processing now always writes a new file by design.

Validation (macOS arm64, SDK 12.0.100-alpha.1)

  • dotnet build src/TestUtils/src/UITest.Analyzers/UITest.Analyzers.csproj -c Release --no-incremental: fails with RS1038 before the fix; 0 warnings and 0 errors after.
  • dotnet test src/TestUtils/tests/UITest.Analyzers.Tests/UITest.Analyzers.Tests.csproj -c Release: passed, 53 tests.
  • dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj -p:Include{Android,Ios,MacCatalyst,MacOS,Windows}TargetFrameworks=false --filter "FullyQualifiedName~ShellContentQueryParameterTests|FullyQualifiedName~ShellModalTests|FullyQualifiedName~ShellRouteTemplatesTests": passed, 175 tests.
  • Trim check: a net12.0 console app referencing the locally built Microsoft.Maui.Controls.dll and reaching both methods, published with PublishTrimmed, TrimMode=full, TrimmerSingleWarn=false and _TrimmerShowRedundantSuppressions=true.
    • Before: IL2121 for the IL2026 suppressions on both methods.
    • After: no IL2121 or other trim warnings from QueryPropertyConversion.
  • QueryPropertyGenerator run over the real Issue17521.cs/Issue33356.cs in a scratch net12.0 project with EnableTrimAnalyzer=true.
    • Before: MAUI1200 ("the containing type ... is not partial") and no generated code.
    • After: no diagnostics, and the IQueryAttributable implementations are generated.
  • CsWinRT check: a scratch net12.0-windows project with WindowsSdkPackageVersion 10.0.19041.44, a non-partial outer class and a nested partial INotifyPropertyChanged class.
    • Reproduces CS0260 from Generator.WinRTAotSourceGenerator.
    • Builds when the outer class is partial.
  • The rewritten ImageProcessor_Tests.cs compiles for net12.0-windows10.0.19041.0 in a scratch project against Windows-built Essentials and Graphics. The origin/main version reproduces CS0117 there.

Not validated locally, so this relies on CI:

  • the Windows HostApp and Essentials.DeviceTests builds (the WinUI XAML compiler and MakePri only run on Windows);
  • running the Windows Issue38570 device test;
  • the iOS TrimFull integration test;
  • the UI test runs.

Issues Fixed

No separate issue. Fixes main build breaks introduced by #40641, #40387 and #36581.

simonrozsival and others added 4 commits November 26, 2026 21:04
Microsoft.CodeAnalysis.Analyzers 5.12.0 (#40641) adds RS1038, which
fails every UI test build because UITest.Analyzers references
Microsoft.CodeAnalysis.CSharp.Workspaces for its code fix providers.

The analyzer types don't use Workspaces APIs, so the compiler can load
and run them without Workspaces; the code fixes are only loaded by IDEs,
which provide it. The assembly is test-only and isn't shipped.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
#40387 made the nested _17521CatDetailsPage and _33356CatDetailsPage
partial but not their containing Shell types. The QueryProperty
generator skips such types, so navigating to them throws at runtime on
every platform. On Windows the build also fails with CS0260: the
CsWinRT 2.1.2 AOT generator in the pinned Windows SDK projection
(10.0.19041.44) emits a partial declaration of the containing type for
nested partial classes that implement INotifyPropertyChanged. Newer
CsWinRT versions skip types with non-partial containers.

ShellSearchControlPage.SearchDetailPage wasn't partial either, so its
query property throws at runtime in the same way.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
No call in ApplyLegacyQueryProperties or ValidateGeneratedQueryProperties
requires unreferenced code, so ILLink reports IL2121 for the IL2026
suppressions. iOS trimmed builds report IL2121, which fails the
RunOniOS_MauiReleaseTrimFull_CoreCLR integration test. The IL2067 and
IL2072 suppressions are still used.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
#36581 replaced the Windows ImageProcessor.RotateImageAsync with the
shared Graphics-based ImageProcessor, breaking the Windows Essentials
device test build (CS0117, followed by WMC0001 because the XAML
compiler can't resolve MiddleApp without the C# compile).

The Issue38570 test now processes the image through
ProcessImageToCacheFileAsync with the options MediaPicker uses for
RotateImage = true, and still checks that the stored pixels are rotated
exactly once and that the preserved metadata doesn't rotate them again.
Processing always writes a new file now, so the unchanged-stream check
for orientation 1 no longer applies.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 20:10
@github-actions

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Required Windows build and native image-codec checks and iOS full-trim validation remain unverified, with CI results unavailable for human confirmation.

No open issues 🎉

What changed in this PR

This PR addresses four build breaks on main following analyzer, query-property generation, and image-processing changes. It also enables generated query setters for affected nested Shell pages.

Changes:

  • Suppresses RS1038 in the test-only analyzer project and removes two unused IL2026 suppressions.
  • Adds required partial declarations for nested query-property source generation.
  • Migrates the Windows image-orientation regression test to the shared cache-file processing API, preserving codec and rotation checks.
File Description
src/​TestUtils/​src/​UITest.Analyzers/​UITest.Analyzers.csproj Suppresses RS1038 with a project-specific explanation.
src/​Essentials/​test/​DeviceTests/​Tests/​Windows/​ImageProcessor_Tests.cs Uses the current processing API and cleans up generated cache files.
src/​Controls/​tests/​TestCases.HostApp/​Issues/​Issue33356.cs Makes the containing Shell partial for source generation.
src/​Controls/​tests/​TestCases.HostApp/​Issues/​Issue17521.cs Makes the containing Shell partial for source generation.
src/​Controls/​tests/​TestCases.HostApp/​FeatureMatrix/​Shell/​ShellSearch/​ShellSearchControlPage.xaml.cs Makes the search detail page partial for generated query setters.
src/​Controls/​src/​Core/​Shell/​QueryPropertyConversion.cs Removes unused IL2026 suppressions that trigger IL2121.

Review effort: Balanced

@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — 0 findings

Reviewed commit c7542a0.

@simonrozsival

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

…0 test

Disposing the AsStreamForWrite adapter closes the underlying
InMemoryRandomAccessStream, so seeking it afterwards threw
ObjectDisposedException in all eight Windows cases. Decode and assert
inside the adapter's using block, as the original test did.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 22:58
@simonrozsival

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Windows builds, EXIF device tests, and iOS full-trim validation remain unverified, so platform CI results are needed before approval.

No open issues 🎉

Review effort: Balanced

The two IDE-only code fix providers were the only reason UITest.Analyzers
referenced Microsoft.CodeAnalysis.Workspaces, which RS1038 flags. They
had no tests. Remove them and the Workspaces reference so the analyzer
builds without the suppression.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 23:21
Copilot AI balanced review requested due to automatic review settings November 26, 2026 23:25
@simonrozsival

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Windows graphics and EXIF behavior and iOS full-trim integration lack independent target-platform validation, requiring maintainer confirmation of native build and runtime results.

No open issues 🎉

Review effort: Balanced

@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Selected Tests

@kubaflo — AI-selected UI tests and device tests (GPT-6.2 Sol + MAI Code 2) for commit dccb8d70.

Result PASSED Platforms Android, iOS, MacCatalyst, Windows Tests 2 UI, 2 device Commit dccb8d70


🧪 Test selection — click to expand
Suite Result Selected Build
UI tests ✅ passed 2 of 77 categories maui-pr-uitests #1701838
Device tests ✅ passed 2 of 105 units maui-pr-devicetests #1701842
🧪 UI tests — Shell1, Shell2 on Android, iOS, MacCatalyst, Windows

✅ maui-pr-uitests #1701838 passed.

GPT-6.2 Sol: Run Shell UI tests on all four platforms to validate generated query properties and the shared UI test build fixes.
MAI Code 2: Shell query-property/source-generation build fixes; run Shell UI tests on every platform.

🧪 Ran — 2 categories on Android, iOS, MacCatalyst, Windows

Platform Categories
Android Shell1, Shell2
iOS Shell1, Shell2
MacCatalyst Shell1, Shell2
Windows Shell1, Shell2
📊 Results — succeeded: 13 passed, 0 failed of 13 jobs

🔗 All test results · Build logs

Job Result
Android UITests CoreClr Controls (API 30) Shell1 ✅ succeeded
Android UITests CoreClr Controls (API 30) Shell2 ✅ succeeded
Android UITests Shell Renderer Controls Shell Renderer (API 30) Shell1 ✅ succeeded
Android UITests Shell Renderer Controls Shell Renderer (API 30) Shell2 ✅ succeeded
Build UITests Android CoreCLR Sample App Build Sample App (Android) ✅ succeeded
Build UITests CoreCLR Sample App Build Sample App ✅ succeeded
Build UITests Windows Sample App Build Sample App (Windows) ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Shell1 ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Shell2 ✅ succeeded
MacCatalyst UITests CoreCLR Controls Shell1 ✅ succeeded
MacCatalyst UITests CoreCLR Controls Shell2 ✅ succeeded
WinUI UITests Controls Shell1 ✅ succeeded
WinUI UITests Controls Shell2 ✅ succeeded
🧪 Device tests — Controls.Shell, Essentials on Android, iOS, MacCatalyst, Windows

✅ maui-pr-devicetests #1701842 passed.

GPT-6.2 Sol: Select Controls.Shell for the shared trimming fix and Essentials for the Windows EXIF regression test.
MAI Code 2: Windows Essentials image-processor device test update; run Essentials device tests on Windows only.

🧪 Ran — 2 categories on Android, iOS, MacCatalyst, Windows

Platform Categories
Android Controls.Shell, Essentials
iOS Controls.Shell, Essentials
MacCatalyst Controls.Shell, Essentials
Windows Controls.Shell, Essentials
📊 Results — succeeded: 7 passed, 0 failed of 7 jobs

🔗 All test results · Build logs

Job Result
net12.0 CoreCLR Android Helix Tests - Build Build Device Tests Android (CoreCLR) ✅ succeeded
net12.0 CoreCLR Android Helix Tests Run DeviceTests Android (CoreCLR) ✅ succeeded
net12.0 CoreCLR iOS Helix Tests Run DeviceTests iOS (CoreCLR) ✅ succeeded
net12.0 CoreCLR iOS/MacCatalyst Helix Tests - Build Build Device Tests iOS and MacCatalyst (CoreCLR) ✅ succeeded
net12.0 CoreCLR MacCatalyst Helix Tests Run DeviceTests MacCatalyst (CoreCLR) ✅ succeeded
net12.0 Windows Helix Tests - Build Build Device Tests (Windows) ✅ succeeded
net12.0 Windows Helix Tests Run DeviceTests Windows ✅ succeeded
⏭️ Skipped — what neither suite runs

UI tests — 75 categories, 0 platforms

Categories not run: Accessibility, ActionSheet, ActivityIndicator, Animation, AppLinks, Border, BoxView, Brush, Button, CarouselView, CollectionView1, CollectionView2, CollectionView3, CollectionView4, CollectionView5, CollectionView6, CollectionView7, Cells, CheckBox, ContextActions, CustomRenderers, DatePicker, Dispatcher, DisplayAlert, DisplayPrompt, DragAndDrop, Entry, Editor, Effects, Essentials, FlyoutPage, Focus, Fonts, Frame, Gestures, GraphicsView, Image, ImageButton, IndicatorView, InputTransparent, IsEnabled, IsVisible, Label, Layout, Lifecycle, ManualReview, Maps, Navigation, Page, Performance, Picker, ProgressBar, RadioButton, RefreshView, SafeAreaEdges, Shadow, ScrollView, SearchBar, Shape, Slider, SoftInput, Stepper, Switch, SwipeView, TabbedPage, TableView, TimePicker, TitleView, ToolbarItem, Triggers, ViewBaseTests, VisualStateManager, Window, WebView, Material3

Each skipped platform and category is listed as a maui-pr-uitests (skipped) … status on this commit. Use /azp run maui-pr-uitests for the full suite.

Device tests — 103 categories, 0 platforms

Categories not run: Controls.Accessibility, Controls.Animations, Controls.Application, Controls.Behavior, Controls.Border, Controls.BoxView, Controls.Button, Controls.CarouselView, Controls.CheckBox, Controls.CollectionView, Controls.Compatibility, Controls.ContentView, Controls.DatePicker, Controls.Dispatcher, Controls.Editor, Controls.Element, Controls.Entry, Controls.FlexLayout, Controls.FlyoutPage, Controls.Frame, Controls.Gesture, Controls.HybridWebView, Controls.Image, Controls.Label, Controls.Layout, Controls.Lifecycle, Controls.Map, Controls.Mapper, Controls.Memory, Controls.MenuFlyout, Controls.Modal, Controls.NavigationPage, Controls.Page, Controls.PageTransitions, Controls.Path, Controls.Picker, Controls.RadioButton, Controls.RefreshView, Controls.ScrollView, Controls.SearchBar, Controls.Shape, Controls.Slider, Controls.SwipeView, Controls.Switch, Controls.TabbedPage, Controls.TemplatedView, Controls.TextInput, Controls.Toolbar, Controls.View, Controls.VisualElement, Controls.VisualElementTree, Controls.WebView, Controls.Window, Controls.WindowOverlay, Controls.Xaml, Core.ActivityIndicator, Core.Animation, Core.Application, Core.Border, Core.BoxView, Core.Button, Core.CheckBox, Core.ContentView, Core.DatePicker, Core.Dispatcher, Core.Editor, Core.Element, Core.Entry, Core.FlowDirection, Core.FlyoutView, Core.Fonts, Core.Formatting, Core.Graphics, Core.GraphicsView, Core.Image, Core.ImageButton, Core.ImageSource, Core.IndicatorView, Core.Label, Core.Layout, Core.Lifecycle, Core.MauiContext, Core.Memory, Core.NavigationPage, Core.Page, Core.Picker, Core.ProgressBar, Core.RadioButton, Core.RefreshView, Core.ScrollView, Core.SearchBar, Core.ShapeView, Core.Slider, Core.Stepper, Core.SwipeView, Core.Switch, Core.TimePicker, Core.View, Core.WebView, Core.Window, Core.WindowOverlay, Graphics, BlazorWebView

Each skipped platform and project is listed as a maui-pr-devicetests (skipped) … status on this commit. Use /azp run maui-pr-devicetests for the full suite.

🤖 Why these tests — AI rationale (GPT-6.2 Sol + MAI Code 2)

UI tests

Each model chose independently; every test that runs was selected by at least one of them.

Platform GPT-6.2 Sol MAI Code 2
Android Shell1, Shell2 Shell1, Shell2
iOS Shell1, Shell2 Shell1, Shell2
MacCatalyst Shell1, Shell2 Shell1, Shell2
Windows Shell1, Shell2 Shell1, Shell2

GPT-6.2 Sol — Run Shell UI tests on all four platforms to validate generated query properties and the shared UI test build fixes.

  • Issue17521 and Issue33356 are Shell1; SearchDetailPage and shared QueryPropertyConversion warrant both Shell shards.
  • Shell runs rebuild UITest.Analyzers on every platform; NoWarn changes only RS1038 reporting, so unrelated UI categories are excluded.

MAI Code 2 — Shell query-property/source-generation build fixes; run Shell UI tests on every platform.

  • The Issue17521 and Issue33356 Shell containers and the Shell search detail page become partial, enabling nested query-property generation across platforms.
  • QueryPropertyConversion only loses redundant trimming suppressions, so there is no broader runtime change.
  • The UITest analyzer change only suppresses RS1038 for the existing test analyzer assembly; no unrelated UI categories or full run are needed.

Device tests

Each model chose independently; every test that runs was selected by at least one of them.

Platform GPT-6.2 Sol MAI Code 2
Android Controls.Shell, Essentials —
iOS Controls.Shell, Essentials —
MacCatalyst Controls.Shell, Essentials —
Windows Controls.Shell, Essentials Essentials

GPT-6.2 Sol — Select Controls.Shell for the shared trimming fix and Essentials for the Windows EXIF regression test.

  • QueryPropertyConversion is shared Shell code; select Controls.Shell on all four platforms.
  • The EXIF test is Windows-only; Essentials is the selectable unit and shares the platform list with Shell.
  • UI-only files and unrelated device units are excluded.

MAI Code 2 — Windows Essentials image-processor device test update; run Essentials device tests on Windows only.

  • ImageProcessor_Tests.cs changes a Windows-only Essentials device test to exercise ProcessImageToCacheFileAsync and EXIF orientation behavior.
  • The remaining changes are UI-test host or analyzer/build fixes and do not affect device-test applications; other platforms and projects are omitted.

Generated by /review run-tests. A targeted run is a fast signal, not full-suite certification.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expert Review — No more findings

Reviewed commit dccb8d7.

simonrozsival added a commit that referenced this pull request Nov 27, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@simonrozsival simonrozsival mentioned this pull request Nov 27, 2026
1 of 4 tasks
kubaflo added a commit that referenced this pull request Nov 27, 2026
…st (#40692)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change


`ContentButtonControlTests.ReparentingChildDuringHandlerCreationKeepsItInNewParent`
(added with the native `ContentButton` in #39762) fails on Windows only,
packaged and unpackaged, at its last assertion:

```
Assert.Same() Failure: Values are not the same instance
Expected: ContentPanel { ..., ActualSize = <0, 0>, ... }
Actual:   null
```

It never failed on `main`'s CI because Windows device tests have not
built there since #36581 (#40666 fixes that build).

The test creates its handlers with `CreateHandler`, which never adds
them to a window, so none of the WinUI elements are in the live tree. In
the original label's `HandlerChanged` callback it swaps the button's
content and moves the label into a `ContentView`. The last assertion
asked a WinUI parent query whether the label's `TextBlock` is parented
to the destination `ContentPanel`:

1. The original helper used `VisualTreeHelper.GetParent`, which [returns
null for any element outside the live
tree](https://github.com/microsoft/microsoft-ui-xaml/blob/main/dxaml/xcp/dxaml/lib/VisualTreeHelper.cpp)
("Don't return the parent unless we're in the live tree"). So that
failure didn't show anything about the product.
2. This PR's first commit switched to `FrameworkElement.Parent`. That
still returned `null` on CI (`maui-pr-devicetests` 1702098 on #40667,
with product code identical to `main`). Microsoft's docs say `Parent`
"can be null if an object was instantiated, but is not attached to an
object that eventually connects to a page object root".

Static tracing of the product path finds no step that detaches the
`TextBlock` or replaces the label's handler. The guarded
`ContentButtonHandler.MapContent` returns before touching the label once
the content has changed, and `ContentViewHandler.UpdateContent` adds the
`TextBlock` to the destination `ContentPanel`. Still, a parent query
that reads null off-tree can't tell a reporting gap from a real product
bug.

The test now checks the invariant directly on Windows instead of asking
WinUI for a parent:
- the label keeps the platform view it had right after the move;
- the destination `ContentPanel`'s children contain that view (checked
by enumerating its children and comparing references);
- the button's `ContentPanel` does not contain it.

A WinUI element can belong to only one parent, so this is as strict as
the previous parent check. Each assertion message records the view's
`Parent`, its `VisualTreeHelper` parent, and both panels' `Content` and
children, captured both right after the move and at the end. If the
product is wrong, the failure shows where the view went. Android
(`View.Parent`) and iOS (`Superview`) keep the parent assertion, which
works outside a window.

**Validation**
- Windows can't be built or run on the macOS dev machine. The new
Windows code was type-checked against the WinUI 2.3.9 reference
assemblies in a scratch `net10.0-windows10.0.19041.0` project, with
stubs for the internal MAUI types (`dotnet build`: succeeded; a
deliberate misspelling was reported as CS1061). The file was also
compiled with each of `ANDROID`, `IOS`, `MACCATALYST` and `WINDOWS`
defined: the only errors were missing references from compiling outside
the device-test project, with no syntax, preprocessor or missing-name
errors in the new code.
- The Windows device-test result needs CI (`maui-pr-devicetests`) on a
branch that includes the build fix from #40666.

### Issues Fixed

Fixes a Windows device-test failure in `ContentButtonControlTests` (no
separate issue). It was seen in `maui-pr-devicetests` builds 1701680 and
1702098 (#40667) and 1701815 (#40666).

### Let AI finish this PR

- [ ] **Let the MAUI agent address review feedback and fix remaining
issues on this PR.** Maintainers still decide whether it is merged. For
PRs from forks, the agent opens a follow-up PR that keeps your commits.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
@kubaflo
kubaflo merged commit d5f63d9 into main Nov 27, 2026
275 of 284 checks passed
@kubaflo
kubaflo deleted the simonrozsival-fix-main-ci-build-breaks branch November 27, 2026 10:35
kubaflo added a commit that referenced this pull request Nov 27, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

This PR is stacked on #40666 (`simonrozsival-fix-main-ci-build-breaks`)
and should be retargeted to `main` once #40666 merges.

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change

#40666 suppresses RS1038 in `UITest.Analyzers`. RS1038 ("This compiler
extension should not be implemented in an assembly containing a
reference to Microsoft.CodeAnalysis.Workspaces") started failing UI test
builds after `Microsoft.CodeAnalysis.Analyzers` was bumped to 5.12.0 in
#40641. This PR fixes the cause so the suppression can be removed.

RS1038 only looks at the assembly's references, so a
`[DiagnosticAnalyzer]` and a Workspaces reference can't be in the same
assembly. Only the two code fix providers need Workspaces, so this PR
moves them into their own project:

- **New `src/TestUtils/src/UITest.Analyzers.CodeFixes`:** contains
`NUnitTestMissingCategoryMethodCodeFixProvider` and
`NUnitTestMissingCategoryClassCodeFixProvider`, moved with history. It
references `Microsoft.CodeAnalysis.CSharp.Workspaces` 4.8.0 and
`UITest.Analyzers`, which provides the diagnostic IDs.
- **`UITest.Analyzers`:** drops the Workspaces package and removes
`RS1038` from `NoWarn`, along with its comment. It now references only
compiler packages.
- **`Controls.TestCases.{Android,iOS,Mac,WinUI}.Tests`:** each also
loads the CodeFixes project as an analyzer, so the IDE code fixes keep
working.
- **Solutions:** the new project is added to `Microsoft.Maui.sln`,
`Microsoft.Maui-dev.sln`, `Microsoft.Maui-vscode.sln` and
`Microsoft.Maui-windows.slnf`.

### Validation

- `dotnet build
src/TestUtils/src/UITest.Analyzers/UITest.Analyzers.csproj -c Release
--no-incremental`: succeeded with no warnings and no RS1038.
- `dotnet build
src/TestUtils/src/UITest.Analyzers.CodeFixes/UITest.Analyzers.CodeFixes.csproj
-c Release --no-incremental`: succeeded with no warnings.
- `dotnet test
src/TestUtils/tests/UITest.Analyzers.Tests/UITest.Analyzers.Tests.csproj
-c Release`: passed, 53/53.
- `dotnet build
src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj
-c Release -p:ExtraDefineConstants=MACUITEST
-p:Include{Android,Ios,MacCatalyst,MacOS,Windows}TargetFrameworks=false`:
succeeded. With a temporary test that had no `[Category]`, the build
failed with MAUI0001 as expected, which confirms the analyzer is still
active.
- `dotnet format` on the new project: no changes.

### Issues Fixed

Follow-up to #40666; no separate issue.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
kubaflo added a commit that referenced this pull request Nov 28, 2026
…otnet test migration to net11 (#40763)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

Repository infrastructure only; targets `net11` so its CI, agentic and
release tooling matches `main`.

### Description of Change

Brings the repository-infrastructure merges from `main` (since `net11`
diverged) to `net11`: `/review` run-tests / run-ui-tests /
run-device-tests, MAUI Autopilot, release tooling, signing validation
and related docs. Each commit is a `git cherry-pick -x` of the merged
PR; all applied without conflicts (the `eng/` part of #40545 was already
backported in #40629).

**Included (28 commits):**
- [release] Recover from squash-merged CI normalization PRs (#40566)
- [Release state] Advance 11.0.1xx to SR3 (#40571)
- [ci] /review run-tests, run-ui-tests and run-device-tests; MAI Code 2
as the second model (#40545)
- Document that forward PRs must never use long-lived branches as head
(#40582)
- [ci] /review run-tests: standard /review comment layout; fix MAI Code
2 (#40591)
- [ci] /review run-tests: don't rewrite Result badges of older comments
(#40592)
- [ci] /review run-tests: show each Azure DevOps job as a check on the
PR (#40612)
- Remove standalone /review gate workflow (#40595)
- [ci] Hide /review run-tests command comments once acknowledged
(#40593)
- [ci] /review run-tests: report jobs as commit statuses named after the
pipeline (#40624)
- Remove standalone /review tests failure-analysis lane (#40596)
- [ci] /review run-tests: build PRs only with their target branch's
pipeline (#40628)
- [ci] /review run-tests: report skipped, selection and run checks as
commit statuses (#40627)
- [ci] /review run-tests: fix the dispatch crash on existing statuses;
log refused dispatches (#40631)
- [ci] /review run-tests: let release-branch dispatches be pushed
(#40634)
- [ci] Re-enable signing validation in the official pipeline (#39524)
- Group Dependabot NuGet updates for main and net11 (#40650)
- [ci] Hide dogfood and skill validation comments (#40651)
- Add MAUI Autopilot: /review autopilot drives review → fix → tests on
opted-in PRs (#40668)
- MAUI Autopilot: three-model cross-examined fixes (adds Claude Opus
5.5), Copilot review threads, test failure evidence, clear endings
(#40672)
- [release] Merge candidate into inflight daily without rewriting
history (#40671)
- MAUI Autopilot: three-model triage of failing tests and a
needs-maintainer-decision label (#40707)
- MAUI Autopilot: install the repository .NET SDK so fix rounds can run
unit tests (#40732)
- MAUI Autopilot: a maintainer's /review autopilot always runs (#40738)
- MAUI Autopilot: every /review autopilot handles all earlier review
suggestions; stop no-op issue mentions (#40743)
- MAUI Autopilot: fix fork follow-ups (squash out-of-src commits, proper
endings) and never fail on missing test evidence (#40746)
- MAUI Autopilot: resolve merge conflicts, add UI screenshot baselines
from Azure DevOps, back off on rate limits (#40750)
- Migrate tests from Helix and XHarness to native dotnet test (#40661)
[net11] — conflicts resolved to the net11 tree CI-validated in #40703
(`net11.0` TFM, CoreCLR **and Mono** device-test runtimes, net11 Arcade
SDK); SourceGen tests for .NET 12-only features are not brought over.

**Deliberately excluded:**
- .NET 12 product features and bug fixes (animations, ContentButton,
ScrollAnchorMode, trimming, XSG styles, Label.IsTextSelectable,
Preferences enums, image metadata, QueryProperty, binding/route/XAML
fixes, …).
- #40060 Move main to .NET 12; main-only build-break fixes (#40666,
#40674, #40708, #40720, #40751) and #40663 platform-compatibility
re-enable (product code changes).
- Dependabot bumps (#40639, #40640, #40641, #40643) — `net11` gets its
own grouped Dependabot updates (#40650); localization check-ins.
- #40615 — empty commit upstream.

**Note for reviewers:** #40672 adds `maui-expert-autopilot-opus` (Claude
Opus 5.5). `CopilotPipeline.Tests.ps1` → "contains no Anthropic model
identifiers" fails on it exactly as it does on `main` today. Drop that
workflow here if `net11` should keep that policy test green.

### Validation

**CI (`/azp run` on this PR):**
| Pipeline | Result |
| --- | --- |
| `maui-pr`
[1703708](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1703708)
(build, pack, unit + integration tests on `dotnet test`/MTP) | ✅
succeeded |
| `maui-pr-uitests`
[1703714](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1703714)
| ✅ succeeded |
| `maui-pr-devicetests`
[1703715](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1703715)
| 38/41 jobs ✅ — all Android, iOS, Mac Catalyst (CoreCLR + Mono) pass |

Device-test failures (Windows only):
- `Windows controls packaged/unpackaged`: test host terminates with
`0xDEAD` in the NavigationPage category — the known Windows blocker
listed in #40661; the same two jobs fail on `main` after #40661
([1703728](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1703728))
and on #40703
([1703325](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1703325)).
- `Windows blazorwebview unpackaged`: one test,
`InterceptedResponseWithoutABodyIsServedWithASingleContentTypeHeader(isContentNull:
False)`, timed out after 30 s waiting for CoreWebView2. The same lane
passed on #40703.

GitHub checks: `Validate (PR)` (Release Readiness) fails in
`MauiReleaseConfiguration.Tests.ps1` ("Wrong evaluated label on
candidate/11.0.1xx-sr1"). It is triggered here because #40566 touches
`MauiReleaseConfiguration.psm1`, and #40566 failed the same check on
`main`; it also fails locally on unmodified `net11`. Skill-validation
evals fail on unavailable `COPILOT_PAT_*` tokens and fixture fetches,
the same as on #40661/#40703.

**Local:** `actionlint` on changed workflows (exit 0); YAML and
PowerShell parse of all changed files (no errors). Pester over the
`powershell-script-tests.yml` paths: 26 failures vs 28 on unmodified
`net11`. The only new failure is the Anthropic-model policy test (see
note above), which also fails on `main`.

### Issues Fixed

N/A — repository infrastructure sync.

### Let AI finish this PR

- [ ] **Let the MAUI agent address review feedback and fix remaining
issues on this PR.** Maintainers still decide whether it is merged. For
PRs from forks, the agent opens a follow-up PR that keeps your commits.

---------
kubaflo added a commit that referenced this pull request Dec 1, 2026
<!-- copilot-assessment:v1 -->
### Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: `4a9b444152e010f5bcc72b7a5a4b987ab65128ac`

| Dimension | Assessment | Rationale |
|---|---|---|
| Change confidence | 8.5/10 | ↑ 66 QueryProperty generator and fixer
tests pass, including generated-declaration regressions.<br>↑ The
packaged fixer worked in the VS Code Roslyn language server for single
fixes and all three Fix All scopes, including a generated containing
type.<br>↓ Visual Studio and OmniSharp were not tested.<br>↓ CI on the
updated head is not yet complete. |
<!-- /copilot-assessment -->

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

This .NET 12 change follows #40676, which has been merged to `main` and
was stacked on #40674 and #40666. It adds the partial-keyword code fix
as the separate second PR in the QueryProperty change.

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change

<!-- Enter description of the fix in this section -->

When MAUI1200 is reported because a `[QueryProperty]` type or one of its
containing types is not partial, offer a "Make type partial" IDE fix
when the required declarations can be edited.

- The generator reports a missing `partial` modifier, marked as fixable,
only when that is the sole reason generation is blocked. If anything
else also blocks it (init-only or inaccessible setters, unsupported
property types, obsolete errors, and so on), that other reason is
reported and no fix is offered.
- The fixer adds `partial` to every non-partial declaration of the type
and of each containing type, including declarations split across
documents and mixed partial/non-partial declarations. Already-partial
generated declarations are left untouched; if a generated declaration
would need editing, the fix is not offered and Fix All skips that
diagnostic.
- Fix All offers Document, Project and Solution scopes. IDE hosts do not
pass source-generator diagnostics to `FixAllContext`, so Fix All reruns
the QueryProperty generator once per selected project, skips suppressed
diagnostics, and applies one solution-wide edit. Generator diagnostic
locations keep the original syntax tree so documents without a file path
map correctly.
- Keep the fixer in its own
`Microsoft.Maui.Controls.SourceGen.CodeFixes` assembly because generator
assemblies must not reference Roslyn Workspaces (RS1038).
- Include focused tests for classes, records, containing types,
inherited attributes, split and mixed declarations across documents,
generated declarations, Fix All, and unsupported reasons with and
without `partial`.
- Package the fixer with Controls Build.Tasks and load it through
`Microsoft.Maui.Controls.targets`.

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #

### Let AI finish this PR

- [ ] **Let the MAUI agent address review feedback and fix remaining
issues on this PR.** Maintainers still decide whether it is merged. For
PRs from forks, keep "Allow edits by maintainers" on so the agent can
push to your branch; otherwise it opens a follow-up PR that keeps your
commits.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

**Validation**
- `dotnet test
src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj
--no-restore -p:IncludeAndroidTargetFrameworks=false
-p:IncludeIosTargetFrameworks=false
-p:IncludeMacCatalystTargetFrameworks=false
-p:IncludeMacOSTargetFrameworks=false -p:AssemblyVersion=11.0.0.0
--filter 'FullyQualifiedName~QueryProperty' -v:q`: passed, 66/66.
- `dotnet pack src/Controls/src/Build.Tasks/Controls.Build.Tasks.csproj
--no-restore -p:IncludeAndroidTargetFrameworks=false
-p:IncludeIosTargetFrameworks=false
-p:IncludeMacCatalystTargetFrameworks=false
-p:IncludeMacOSTargetFrameworks=false -p:AssemblyVersion=11.0.0.0 -o
artifacts/queryproperty-verification/packages -v:q`: passed. The package
contains the generator and code-fix DLLs under
`buildTransitive/netstandard2.0`, and `Microsoft.Maui.Controls.targets`
adds both as `Analyzer` items.
- The VS Code Roslyn language server, loading the analyzers from the
packed nupkg, offered "Make type partial" and applied the single fix and
Document, Project and Solution Fix All across two projects, split
declarations, a linked file, an unsaved edit and a generated containing
declaration. Suppressed MAUI1200 and an unsupported init-only property
were left unchanged.
- Earlier, `dotnet build` of `Controls.SourceGen.csproj` and
`Controls.SourceGen.CodeFixes.csproj` (`--no-incremental`) passed with 0
warnings.
- An earlier Roslyn `AdhocWorkspace` smoke test loaded the analyzers
from the packed nupkg through `AnalyzerFileReference`, discovered the
fixer, and applied Solution Fix All across three files. This simulated
host provided generator diagnostics to Fix All.
- Earlier, a project importing the packed
`Microsoft.Maui.Controls.targets` with
`_MauiBindingInterceptorsSupport=false` built successfully.
- Not checked: Visual Studio and OmniSharp themselves (neither is
installed here).

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants