Repository navigation
[release/10.0.1xx] [msbuild] Detect legacy UIKit lifecycle apps built against SDK 27 - #26989
Conversation
Validate the merged iOS and Mac Catalyst app manifest when building against SDK 27.0 or later, before legacy-lifecycle apps reach their native launch-time crash. Report MT7198 with migration guidance at https://aka.ms/uiscene and an explicit ValidateSceneManifest=false escape hatch. Exclude app extensions, frameworks, other Apple platforms and older SDKs. Accept dynamically configured scenes with an empty manifest dictionary, and include the opt-out in incremental-build inputs. Do not write a successful-looking manifest after validation fails, so repeated builds cannot bypass the error. Document the property and diagnostic, and cover SDK boundaries, manifest types, partial manifests, exclusions, opt-out behavior and incremental revalidation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move the conditional ValidateSceneManifest=true default from Xamarin.Shared.targets to Xamarin.Shared.props alongside the app-manifest defaults, following the existing property initialization convention. Keep task wiring and incremental-build inputs unchanged, and continue to preserve explicit opt-out values. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Check that the compiled manifest task item is present before using its path in the new scene lifecycle tests. Fail explicitly when the helper's required output is missing instead of suppressing nullable analysis. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Migrate MySingleView to create its window in a scene delegate, and move MyCatalystApp's storyboard into its scene configuration with a registered scene delegate. Both UI apps can now use the scene lifecycle required by SDK 27 without bypassing manifest validation. Explicitly disable ValidateSceneManifest for generated console-only fixtures, MaxSupportedOSPlatformVersion, and VeryManyRegisteredAssemblies. These executables do not start UIKit, so requiring a scene manifest would obscure the build and registrar behavior they are intended to test. The shared generated-project change also covers the remote Windows entitlements test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The build regression lacks working invalid-manifest input, and the diagnostic identifier conflicts with the confirmed upstream allocation.
2 open issues
What changed in this PR
Backports build-time detection of legacy UIKit lifecycle apps to release/10.0.1xx, helping developers catch missing scene manifests before SDK 27 apps fail at launch.
Changes:
- Validates merged iOS and Mac Catalyst manifests, with an opt-out property and incremental-build tracking.
- Adds task and build regression tests, migrates two test apps to scenes, and exempts console-only fixtures.
- Documents the validation property, diagnostic, and migration guidance.
| File | Description |
|---|---|
| tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/CompileAppManifestTaskTests.cs | Adds validation, exemption, and partial-manifest tests. |
| tests/dotnet/UnitTests/TestBaseClass.cs | Disables validation for generated console projects. |
| tests/dotnet/UnitTests/TemplateProjectTest.cs | Exempts a console-entry-point fixture. |
| tests/dotnet/UnitTests/PartialAppManifestTest.cs | Adds validation and incremental-build regressions. |
| tests/dotnet/MySingleView/Info.plist | Declares the scene configuration. |
| tests/dotnet/MySingleView/AppDelegate.cs | Moves window creation into a scene delegate. |
| tests/dotnet/MyCatalystApp/Info.plist | Moves storyboard configuration into the scene manifest. |
| tests/dotnet/MyCatalystApp/AppDelegate.cs | Adds a scene delegate. |
| msbuild/Xamarin.Shared/Xamarin.Shared.targets | Passes and tracks the validation property. |
| msbuild/Xamarin.Shared/Xamarin.Shared.props | Enables validation by default. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs | Validates scenes and avoids saving after validation errors. |
| msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx | Adds the migration diagnostic text. |
| docs/website/mtouch-errors.md | Documents the new diagnostic. |
| docs/building-apps/build-properties.md | Documents validation scope and opt-out behavior. |
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The .NET 10 release branch does not have the framework-output support that introduced CompileAppManifest.IsFramework on main. Remove the framework exemption from the backported scene lifecycle validator and its tests instead of referencing a task property that does not exist on this branch. Keep coverage for SDK version gating, supported platforms, app extensions, the validation opt-out, and merged scene manifests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…backport-pr-26936-release/10.0.1xx-2026-10-22
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The release branch does not support AppManifestEntry, and MyPartialAppManifestApp never consumes ManifestKey or ManifestValue. Setting those properties leaves the shared scene manifest valid, so the build unexpectedly succeeds. Allow the test app to include an additional partial manifest and have the regression test supply an invalid UIApplicationSceneManifest through that supported path. Preserve coverage for repeated validation failures, opting out, re-enabling validation, and restoring a valid manifest without backporting an unrelated feature. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🚀 [CI Build #44b5f46] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 200 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |

Apps that still use the legacy UIKit lifecycle can build successfully with Xcode 27, then crash at launch on iOS or macOS 27. Detect the common missing-scene-manifest case during the build instead, with an actionable error for developers and AI assistants.
Validate the final merged
Info.plistfor iOS and Mac Catalyst apps built against SDK 27.0 or later. IfUIApplicationSceneManifestis missing or is not a dictionary, report MT7199 with migration guidance at https://aka.ms/uiscene. Developers can opt out using<ValidateSceneManifest>false</ValidateSceneManifest>; this only disables the build check, not Apple's runtime requirement.Xamarin.Shared.propsand track it in the manifest compilation inputs so toggling validation invalidates incremental outputs.Note
🤖 Pull request created by Copilot
Backport of #26936.