Repository navigation
Description
Environment
- .NET SDK: 10.0.400
- iOS workload: 26.5.10315/10.0.100
- Xcode: 26 (native macOS build, not Pair-to-Mac)
- Target: net10.0-ios, ios-arm64
- Container app: .NET MAUI (net10.0-ios)
- Extension type: Share Extension (NSExtensionPointIdentifier = com.apple.share-services)
Summary
A from a .NET MAUI iOS app to a net10.0-ios app-extension project compiles the extension into a real, valid .appex bundle — confirmed by extracting and inspecting it directly. But the built .appex is never copied into .app/PlugIns/ during dotnet build/dotnet publish, so the extension never appears in iOS's share sheet, and no error or warning is raised — the container app just builds and installs successfully without its extension.
Repro steps
- Create a .NET MAUI app targeting net10.0-ios.
- Add a second project targeting net10.0-ios with true (Share Extension NSExtension in Info.plist, NSExtensionPrincipalClass pointing at a UIViewController subclass).
- Reference it from the container app:
<ProjectReference Include="..\Extension\Extension.csproj" IsAppExtension="true" />. - dotnet build/dotnet publish -f net10.0-ios -c Release (or Debug) on macOS, natively (not via Pair-to-Mac from Windows — see "Ruled out" below).
- Inspect the built .app: find
<ContainerApp>.app/PlugIns— empty or missing, despite the extension project having built successfully.
What was ruled out (each independently tested, not assumed)
- Pair-to-Mac as the cause: initially suspected, and a related-but-different bug was found and fixed for it (_BuildReferencedExtensionProjects defaulting to false on Windows-hosted builds, fixed upstream in dotnet/macios#25805, confirmed present in this SDK version). But the PlugIns-copy issue reproduces identically on a fully native macOS build — installed the SDK + workloads directly on the Mac, built with dotnet build/dotnet publish locally, no Windows/Pair-to-Mac involved at all. Same result: clean build, .appex compiles, PlugIns/ stays empty.
- RID mismatch: the extension project's was previously pinned to simulator RIDs only from an earlier, unrelated fix — removed so it inherits the container's RID. No change in behavior.
- Build vs publish, Debug vs Release: tested all four combinations. No change.
- Stale incremental state: full clean (rm -rf bin obj on both projects) before each attempt. No change.
- Windows-style path separators in the ProjectReference Include: not the cause — same result with forward slashes.
- -p:IsMacEnabled=true: found this property in the SDK's own Xamarin.Shared.Sdk.targets as something that partially gates the PlugIns pipeline; forcing it explicitly made no difference.
What the SDK's own source suggests
Reading Xamarin.Shared.Sdk.targets directly in the installed SDK pack (Microsoft.iOS.Sdk.net10.0_26.5/26.5.10315/targets/) shows the PlugIns-publishing logic has two separate code paths — an uncompressed path (_PlugIns, _DirectoriesToPublish) and a compressed/zip-based fallback (_CompressedPlugIns, _DecompressPlugIns, _CollectDecompressedPlugIns) — with a comment in the targets file itself acknowledging this area has known incomplete handling. This reads as genuine, still-open fragility in the SDK's own extension-publishing pipeline rather than a project misconfiguration on our end, but we haven't yet traced exactly which target is failing to add the extension's output to ResolvedFileToPublish (or equivalent) — happy to help narrow this further if a maintainer can point at where that item should be getting added.
Impact
Blocks App Extensions entirely for .NET MAUI iOS apps referencing a sibling extension project the standard way — the extension silently never ships, with no build error to signal `why.```
Activity
conklinpr commentedon Aug 20, 2026
Traced this further by grepping the installed SDK's own .targets files directly (Microsoft.iOS.Sdk.net10.0_26.5/26.5.10315). Two findings that narrow this down:
IsAppExtension is only ever consumed as an MSBuild property ($(IsAppExtension)), never as item metadata (%(IsAppExtension)). Every occurrence in Xamarin.Shared.Sdk.targets/.props governs the extension project's own build behavior when building itself (target platform inference, _CanOutputAppBundle, _FixRootAssemblyForAppExtensions, etc.). I can't find anywhere that reads the IsAppExtension="true" metadata set on the container app's element back out to decide how to classify that reference's resolved output. Those look like two disconnected mechanisms.
PublishFolderType="PlugIns" is only ever assigned in the decompressed/zip-extraction path (_DecompressedPlugIns, e.g. line 2478 of the version above), never for the regular/uncompressed case an app-extension ProjectReference actually produces. I checked this across every SDK version currently installed on this machine (net9.0 and net10.0, several patch versions) — same pattern in all of them.
Together, this suggests the actual bridge — "this ProjectReference is an app extension, therefore tag its resolved output PublishFolderType=PlugIns" — isn't implemented in the shipped .targets XML at all, and most likely lives in a compiled MSBuild task instead, which is out of reach from outside the source tree. If a maintainer can point at where that classification is supposed to happen (or confirm it's simply missing for the uncompressed path), that would let us either work around it correctly or confirm this is a real gap rather than a project misconfiguration.
Grep commands used, for reproducibility:
grep -n -A 40 "_PlugIns|_CompressedPlugIns|_CollectDecompressedPlugIns" "/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.5/26.5.10315/targets/Xamarin.Shared.Sdk.targets"
grep -rn "IsAppExtension" /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net10.0_26.5/26.5.10315/targets/ /usr/local/share/dotnet/packs/Microsoft.MacCatalyst.Sdk.net10.0_26.5/26.5.10315/targets/
grep -rn "PublishFolderType="" /usr/local/share/dotnet/packs/ /usr/local/share/dotnet/sdk/*/
rolfbjarne commentedon Aug 25, 2026
Thanks for the detailed report and for the follow-up investigation.
I tried to reproduce this locally on macOS with the same iOS workload version you're using (
26.5.10315/10.0.100), but so far I haven't been able to — in every combination I tried, the.appexends up in<ContainerApp>.app/PlugIns/as expected.Here's what I tested:
PlugIns/MyExtension.appex✅PlugIns/MyExtension.appex✅dotnet builddotnet publishiossimulator-arm64)ios-arm64)..\Ext\Ext.csproj(backslashes)../Ext/Ext.csproj(forward slashes)Setup used:
dotnet new maui(and separatelydotnet new ios) for the container app,dotnet new ios-notification-service-extensionfor the extension (IsAppExtension=true,OutputType=Library, the extension'sApplicationIdbeing the container's bundle id + a suffix), referenced with:Each run was done after a full
rm -rf bin objon both projects.So there's something in your project setup that differs from mine, and I'd like to find out what. Could you provide a binary log of a failing build? That records exactly which targets ran and what items they produced, which should let me pinpoint where the extension drops out of the pipeline:
(after
rm -rf bin objin both projects), then attachbuild.binloghere — you can zip it if GitHub rejects the extension.Please note that a binlog can contain sensitive information (environment variables, file paths, and the contents of files embedded in the build). You can inspect it first with the MSBuild Structured Log Viewer, and if you'd rather not post it publicly, let me know and we can arrange another way to share it.
Alternatively, a minimal self-contained project that reproduces the problem would work just as well.
Also happy to answer your targets question: the copy into
PlugIns/isn't driven byPublishFolderTypeat all. It happens intools/msbuild/Xamarin.Shared.targets(nottargets/Xamarin.Shared.Sdk.targets, which is what you grepped) —_SeparateAppExtensionReferencesreads theIsAppExtensionmetadata offProjectReference,_ResolveAppExtensionReferencesbuilds those projects and collects the resulting bundle paths,_PlaceAppExtensionstags them withContainerName=PlugIns, and_CopyAppExtensionsToBundledoes the copy. That's the chain the binlog would let us walk.conklinpr commentedon Aug 25, 2026
Thanks for the thorough repro matrix, and for the correction on where the copy actually happens — I was grepping the wrong file (Xamarin.Shared.Sdk.targets instead of tools/msbuild/Xamarin.Shared.targets), good to have the real chain (_SeparateAppExtensionReferences → _ResolveAppExtensionReferences → _PlaceAppExtensions → _CopyAppExtensionsToBundle) to actually walk instead of guessing.
Given you can't reproduce this on a fresh dotnet new maui + dotnet new ios-notification-service-extension pairing, I agree the most likely culprit is something specific to this project rather than a general regression. I'll generate a binlog from the actual failing project (rm -rf bin obj on both, then dotnet build -f net10.0-ios -c Debug /bl:build.binlog) and attach it here shortly.
One difference from your repro worth flagging up front, in case it's relevant before you dig into the binlog: our extension is a Share Extension (NSExtensionPointIdentifier = com.apple.share-services, NSExtensionPrincipalClass pointing at a UIViewController subclass), created by hand rather than via dotnet new ios-notification-service-extension — so it's plausible something about how the extension project itself is set up (rather than the container side) is where this diverges from your clean repro. Will let the binlog do the actual talking rather than speculate further.
conklinpr commentedon Aug 25, 2026
build.binlog.txt
Thanks for the repro matrix and for the correction on where the copy actually happens — good to have the real chain (_SeparateAppExtensionReferences → _ResolveAppExtensionReferences → _PlaceAppExtensions → _CopyAppExtensionsToBundle) instead of the file I was grepping before.
Went to generate the binlog and found something I didn't expect, which may actually explain why my setup diverges from your clean repro.
With the RID left to inference (dotnet build -f net10.0-ios -c Debug, no -r), the build fails before it ever gets to the PlugIns question:
ld: building for 'iOS-simulator', but linking in dylib (.../obj/Debug/net10.0-ios/iossimulator-arm64/nativelibraries/libSystem.Globalization.Native.dylib) built for 'iOS'
clang++: error: linker command failed with exit code 1
The path is under the iossimulator-arm64 intermediate folder, but the .dylib itself is a device build — a simulator/device native-asset mismatch, not something I was trying to reproduce.
Forcing the RID explicitly (-r iossimulator-arm64) avoids that link error and the build succeeds — but the extension project doesn't get built at all in that run: CheckFirst.ShareExtension/bin is completely empty, no .appex anywhere in the repo. So that "success" isn't actually informative — the extension ProjectReference (IsAppExtension="true") just isn't participating in the build when the RID is forced this way.
Ruled out a stale-cache explanation: cleared the entire local NuGet cache (dotnet nuget locals global-packages --clear) and repeated both scenarios — identical results both times.
So the pattern I'm seeing is:
Extension reference included (RID inferred) → container's own native-asset resolution goes wrong (device dylib linked into a simulator build)
Extension reference effectively excluded (RID forced) → container builds clean, but there's nothing to check PlugIns/ against
Attaching build.binlog from the first scenario (RID inferred, extension reference present, build fails on the link error) since that's the one where the extension reference is actually part of the graph. Config: net10.0-ios, -c Debug, CodesignKey/CodesignProvision blanked via -p: to rule out signing-driven RID inference as a factor (made no difference either way).
Let me know if a binlog from the RID-forced (extension-excluded) run would also be useful for comparison — happy to generate that too.
I had to use a .txt extension to be able to upload the build.binlog
rolfbjarne commentedon Aug 27, 2026
Thanks for the binlog — that had everything I needed. There are two separate problems here.
1. The extension is never copied into
PlugIns/Your
ProjectReferenceto the share extension hasReferenceOutputAssembly=false:That turns out to be a bug on our side: when
ReferenceOutputAssemblyisfalse, we still build the extension project, but we drop it from the list of extensions to embed. So the.appexgets built, and then silently ignored — no error, no warning. That's exactly the behavior you're seeing, and it's why the extension shows up inobj//bin/but never inCheckFirst.app/PlugIns/.I have a fix for this in the works.
In the meantime, the workaround is to just remove the
ReferenceOutputAssemblymetadata and keepIsAppExtension:I did try to reproduce the "Metadata file ... could not be found" error that you mention in the comment as the reason for adding it, and I wasn't able to — so if it comes back after removing the metadata, please let me know (with a binlog) and I'll look into that as well.
2. The
ld: building for 'iOS-simulator', but linking in dylib ... built for 'iOS'errorThis one is caused by
CheckFirst/CheckFirst.csproj.user. From your binlog:*.csproj.userfiles are imported very late — long after we've already decided (based on the originaliossimulator-arm64) that this is a simulator build, and configured the clang flags, the sysroot and theobj/+bin/output paths accordingly. Changing theRuntimeIdentifierat that point gets you a build that's half simulator and half device: simulator compiler flags and simulator output directories, but the device runtime pack. The linker error is just the first place where that shows up.It also explains why none of the cleaning helped: neither
rm -rf bin objnordotnet nuget locals --cleartouches.csproj.user.So: delete
CheckFirst/CheckFirst.csproj.user(or at least remove theRuntimeIdentifierfrom it), and the link should succeed. This is also why passing-r iossimulator-arm64explicitly made the linker error go away — it made the two halves agree again.I'm adding a proper error message for this too, so that you get something actionable instead of a linker error.
[dotnet] Detect when the RuntimeIdentifier is changed too late in the…
[msbuild] Embed app extensions even when ReferenceOutputAssembly is f…