[release/11.0.1xx-preview6] [msbuild] Always build referenced extension projects by default#25854
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 that determines whether referenced iOS extension projects (app extensions and watch apps) should be built as part of the main project build. It changes the default so referenced extension projects are built unless the IDE explicitly opts out, addressing Visual Studio 2026 behavior where extension projects may not be built ahead of the main project (resulting in missing .appex outputs).
Changes:
- Default
_BuildReferencedExtensionProjectstotruewhen it has not already been set (instead of keying offBuildingInsideVisualStudio). - Apply the same defaulting behavior for both app extension references and watch app references.
- Update inline comments to document the new rationale and link to #25461.
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 | Defaults referenced app extension builds to on unless _BuildReferencedExtensionProjects is explicitly set. |
| msbuild/Xamarin.Shared/Xamarin.iOS.Common.targets | Applies the same defaulting behavior for referenced watch app projects. |
✅ [PR Build #aaca717] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ 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 #aaca717] Build passed (Build macOS tests) ✅Pipeline on Agent |
✅ [PR Build #aaca717] Build passed (Build packages) ✅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.
🔥 [CI Build #aaca717] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 21 tests failed, 207 tests passed. Failures❌ linker tests (iOS) [attempt 4]21 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download Successes✅ 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 |
Change the condition for _BuildReferencedExtensionProjects from
BuildingInsideVisualStudio != trueto 'not already set'. This way theproperty 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.