I'm using Visual Studio 2022 with Maui to create a cross platform app. I've followed Microsoft's instructions to "Publish an iOS app for App Store distribution", found here: https://learn.microsoft.com/en-us/dotnet/maui/ios/deployment/publish-app-store?view=net-maui-7.0&tabs=vs#create-an-app-id
I use MacInCloud for my Remote iOS device. I connects fine, but when I try to publish, I get the following error: Cannot create an iOS archive... Process cannot be executed on XMA server. Cosign exited with exit code 1. Failed to codesign '....app':Warning:unable to build chain to self-signed root for signer "Apple Distribution"..."... errSecInternalComponent
The solutions I have seen for this type of problem usually direct the developer to the KeyChain on the Mac, but it is my understanding that if you are using Visual Studio on Windows that your certificates and profiles are all just managed in Visual Studio with no need for the keychain.
Also, as another possible clue, when I try to debug my app in the simulator, even if I'm connected to the MacinCloud machine, VS cannot find a specific simulator and I get the error: "Please select a valid device before running the application", so maybe it is a Mac provisioning issue.
I've deleted all my certificates and profiles from the apple developer console and removed my Apple dev account from VS and clean and restated. Then I created a new certificate, appid, provisioning profile and re-downloaded all that to VS and rebuilt the project. Didn't help.