[msbuild] Always build referenced extension projects by default#25805
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
Updates the MSBuild targets used to resolve and build app extension / watch app referenced projects so that referenced extension projects are built by default (unless explicitly overridden), addressing Visual Studio 2026 builds where the IDE may not build the extension project first and the resulting .appex is missing.
Changes:
- Default
_BuildReferencedExtensionProjectstotruewhen it hasn’t already been set (instead of keying off$(BuildingInsideVisualStudio)). - Apply the same defaulting logic for both app extensions and watch app references, with updated inline comments referencing #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 building of referenced app extension projects to on unless explicitly set otherwise. |
| msbuild/Xamarin.Shared/Xamarin.iOS.Common.targets | Applies the same default behavior for referenced watch app projects. |
|
Awaiting independent confirmation this works from: #25666 (comment) |
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.
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #fccff84] Build passed (Detect API changes) ✅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 #fccff84] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #fccff84] Build passed (Build packages) ✅Pipeline on Agent |
🚀 [CI Build #fccff84] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 199 tests passed 🎉 Tests counts✅ assembly-processing: 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 |
Confirmed! As per the other thread, it worked perfectly. Built with no problems and I confirmed with real usage testing the Appex is firing and performing as expected. Thanks. |
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