Repository navigation
[msbuild] Remote build from Windows fails in ReadAppManifest with ArgumentNullException (path2) on 27.0.10722 #26847
Description
Description
Publishing an iOS app from Windows with a remote Mac build (ServerAddress, Pair to Mac) fails since we moved to workload set 10.0.401.1 / Microsoft.iOS.Sdk 27.0.10722 and Xcode 27.0. Compile, linking and AOT on the Mac succeed; the build fails about 12 minutes in, after the archive is created, in the remote ReadAppManifest task:
Xamarin.Shared.targets(3642,3): warning : [xma][err]: Exception in task "ReadAppManifest".
Xamarin.Shared.targets(3642,3): error : MessagingRemoteException: An error occurred on client Build18111529654 while executing a reply for topic xvs/build/18.11.15.29654/execute-task/{AppName}/8e767bf002fReadAppManifest
Xamarin.Shared.targets(3642,3): error : ArgumentNullException: Value cannot be null. (Parameter 'Value cannot be null. (Parameter 'path2')')
Client-side stack:
at Xamarin.Messaging.Client.MessagingClient.PostAsync[TRequest,TResponse](...)
at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](...)
at Xamarin.Messaging.Ssh.MessagingClientPro.PostAsync[TMessage,TResult](...)
at Xamarin.Messaging.Build.Client.BuildClient.ExecuteTaskAsync(String task, String inputs)
at Xamarin.Messaging.Build.Client.TaskRunner.RunAsync(Task task)
The same project built fine every night with workload set 10.0.300.3 (Microsoft.iOS.Sdk 26.5.10284) and Xcode 26.5, until the Mac was upgraded to macOS 27 / Xcode 27. This looks like the same problem as dotnet/maui#39033, which has no response yet; filing here since the failing task lives in this repo.
Steps to reproduce
On a Windows machine, with a Mac reachable over SSH:
dotnet publish App.csproj -f net10.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="..." -p:CodesignProvision="..." -p:ServerAddress=<mac> -p:ServerUser=<user> -p:ServerPassword=<pw> -p:TcpPort=58181 -p:_DotNetRootRemoteDirectory=/Users/<user>/Library/Caches/maui/PairToMac/SDKs/dotnet/
Environment
- Windows: .NET SDK 10.0.401, workload set 10.0.401.1, Microsoft.iOS.Sdk.net10.0_27.0 27.0.10722, Xamarin.Messaging 18.11.15.29654 (from the topic name)
- Mac: macOS 27.0 (Darwin 27.0.0, Apple Silicon), Xcode 27.0; PairToMac .NET SDK 10.0.401 with the same workload set
- Not using Visual Studio; plain
dotnet publishon a build agent
What we looked at
_AddAppleApplicationArtifactMetadata is new in 27.0 (it is not in Microsoft.iOS.Sdk 26.5.10301). It calls ReadAppManifest with AppManifest="$(_AppBundleManifestPath)", and its condition explicitly allows the manifest not to exist locally when IsRemoteBuild is true. With ArchiveOnBuild=true, the comment in _CollectAppleArchiveOutput says CopyArchiveFromMac sets $(ArchivePath) to the local Windows path, and _GenerateBundleName derives _AppContainerDir from $(ArchivePath) for app distribution. Our guess is that _AppBundleManifestPath ends up as a Windows-local (or partly empty) path when the task is executed on the Mac. We have not verified this.
Not tested yet: whether ArchiveOnBuild=false avoids the failure.
Is there a supported way to skip the artifact metadata step for remote builds until this is fixed?
Activity
rolfbjarne commentedon Oct 14, 2026
Could you add
-bl:msbuild.binlogto this command, and then attach the resulting msbuild.binlog file here?See https://github.com/dotnet/macios/wiki/Provide-confidential-information if you don't want to attach the file to a public issue.
dotnet-policy-service commentedon Oct 14, 2026
Hi @ChrisLi-Bear. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
iEWngKvR67 commentedon Oct 14, 2026
Same team as the reporter, adding what we found after digging through the targets and the messaging client. The suspicion in the description was close, but the manifest path itself is fine; the problem is the session client being torn down before the Publish-only target runs:
Publishdepends onGetApplicationArtifacts, which depends onBuild; _AddAppleApplicationArtifactMetadata. So the new metadata target runs afterBuildhas finished.Buildends with_SayGoodbye(fromXamarin.Messaging.Build.targets), which disconnects and callsBuildConnection.RemoveClient(sessionId)._AddAppleApplicationArtifactMetadatacontainsOr '$(IsRemoteBuild)' == 'true', so it runs even thoughInfo.plistdoes not exist on Windows, and sendsReadAppManifestto the Mac.TaskRunnerasksBuildConnection.GetClient(sessionId)for a client. Because the old one was removed, it creates a brand-newBuildClient. OnlySayHellocallsAssociateApp, so the new client hasAppName == null.ExecuteTaskMessagetherefore goes out with a nullAppName. You can see it in the error: the topic still contains the unresolved placeholder,execute-task/{AppName}/<sessionid>ReadAppManifest. On the Mac side the session path is built from builds root + app name + session id, and the null app name is thepath2of thatPath.Combine.Workaround that works for us (csproj):
Note that
ShouldDisconnect=falsealone is not enough: without the explicit_SayGoodbye,dotnet publishkeeps the SSH session open and the process does not exit, and the build signature is never written, so every following build starts with a Clean.ChrisLi-Bear commentedon Oct 14, 2026
The binlog is attached privately to this Developer Community report: https://developercommunity.microsoft.com/t/Private-binlog-for-dotnetmacios26847-/11165990
It's from a clean build (
bin/objdeleted) without the workaround from the comment above, and shows the sameReadAppManifest/path2failure with the{AppName}placeholder in the topic.rolfbjarne commentedon Oct 16, 2026
I haven't tested this, but I believe that adding this to your csproj will work around the error:
basically overriding the
="_AddAppleApplicationArtifactMetadatatarget (which is the one causing the problem) with an empty target.rolfbjarne commentedon Oct 19, 2026
Thanks for the binlog, I've investigated and a few fixes are on the way.
Let me know if the workaround I suggested earlier works; if not please provide another binlog and I'll have a look.
[publish] Copy dSYMs before disconnecting remote builds (#26905)
[msbuild] Diagnose remote task requests without an application name (#…
[release/11.0.1xx] [msbuild] Read artifact metadata locally on Windows.
JSWANS0N commentedon Oct 26, 2026
Could #26904 and #26905 be backported to release/10.0.1xx too, since .NET 10 (iOS 27.1.10018) still hits this?
[msbuild] Read artifact metadata locally on Windows. Fixes dotnet#26847…
rolfbjarne commentedon Oct 27, 2026
Yes, they will be.
[release/11.0.1xx] [publish] Copy dSYMs before disconnecting remote b…
[release/10.0.1xx] [publish] Copy dSYMs before disconnecting remote b…
[release/10.0.1xx] [msbuild] Diagnose remote task requests without an…
[release/10.0.1xx] [msbuild] Read artifact metadata locally on Windows.
[release/11.0.1xx] [msbuild] Diagnose remote task requests without an…