[release/10.0.1xx] [msbuild] Always build referenced extension projects by default#25846
Conversation
Change the condition for _BuildReferencedExtensionProjects from 'BuildingInsideVisualStudio != true' to 'not already set'. This way the property defaults to true (always build extensions), but the IDE can still override it by setting it explicitly. This fixes VS 2026 builds where the IDE doesn't build the extension project before the main project, leaving the .appex missing. Fixes #25461 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the MSBuild logic for iOS/macOS app extension (and watch app) project references so referenced extension projects are built by default unless an external caller (such as the IDE) explicitly sets the controlling property. This addresses Visual Studio 2026 scenarios where extension projects are not built before the main app, resulting in missing .appex outputs and build failures (#25461).
Changes:
- Change the defaulting condition for
_BuildReferencedExtensionProjectsso it becomestruewhen not already set (instead of being disabled whenBuildingInsideVisualStudio=true). - Apply the same defaulting behavior for both app extensions and watch app references to keep behavior consistent across extension-like referenced projects.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| msbuild/Xamarin.Shared/Xamarin.Shared.targets | Default _BuildReferencedExtensionProjects to true when unset for app extension reference resolution. |
| msbuild/Xamarin.Shared/Xamarin.iOS.Common.targets | Default _BuildReferencedExtensionProjects to true when unset for watch app reference resolution. |
✅ [PR Build #5901fb2] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #5901fb2] Build passed (Build packages) ✅Pipeline on Agent |
✅ 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 |
✅ [PR Build #5901fb2] Build passed (Build macOS tests) ✅Pipeline on Agent |
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.
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #5901fb2] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 175 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Change the condition for _BuildReferencedExtensionProjects from
BuildingInsideVisualStudio != trueto 'not already set'. This way the property defaults to true (always build extensions), but the IDE can still override it by setting it explicitly.This fixes VS 2026 builds where the IDE doesn't build the extension project before the main project, leaving the .appex missing.
Fixes #25461
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com
Backport of #25805.