Skip to content

[msbuild] Always build referenced extension projects by default#25805

Merged
rolfbjarne merged 2 commits into
mainfrom
dev/rolf/fix-extension-build-on-windows
Jun 29, 2026
Merged

[msbuild] Always build referenced extension projects by default#25805
rolfbjarne merged 2 commits into
mainfrom
dev/rolf/fix-extension-build-on-windows

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

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

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>
Copilot AI review requested due to automatic review settings June 24, 2026 17:01
@rolfbjarne rolfbjarne requested a review from mauroa as a code owner June 24, 2026 17:01

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.

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 _BuildReferencedExtensionProjects to true when 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.

@rolfbjarne

Copy link
Copy Markdown
Member Author

Awaiting independent confirmation this works from: #25666 (comment)

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #fccff84] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: fccff84a3539b07ce4587dae872c907f6ee82fc0 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: fccff84a3539b07ce4587dae872c907f6ee82fc0 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #fccff84] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: fccff84a3539b07ce4587dae872c907f6ee82fc0 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #fccff84] Build passed (Build packages) ✅

Pipeline on Agent
Hash: fccff84a3539b07ce4587dae872c907f6ee82fc0 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [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
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 17 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: fccff84a3539b07ce4587dae872c907f6ee82fc0 [PR build]

@jonmdev

jonmdev commented Jun 27, 2026

Copy link
Copy Markdown

Awaiting independent confirmation this works from: #25666 (comment)

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.

@rolfbjarne rolfbjarne merged commit 621a041 into main Jun 29, 2026
57 checks passed
@rolfbjarne rolfbjarne deleted the dev/rolf/fix-extension-build-on-windows branch June 29, 2026 10:49
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.

iOS Notification extension .appex file is always missing therefore the build fails, only appears with Visual Studio 2026 (.NET 9 and .NET 10)

5 participants