MAUI for iOS Publish in Visual Studio 2022 for Windows in Parallax VM

Tony Pitman 100 Reputation points
2025-02-05T22:07:05.2566667+00:00

I have a Mac. I have a Parallels Windows 11 VM with Visual Studio 2022 installed with the dotnet SDK and MAUI workloads.

My source code is on the Mac and shared as a drive in the VM so I can open the exact same project on either the Mac using VSCode or the Windows VM using Visual Studio for Windows 2022.

I have connected the VM to my host Mac and am able to build and debug the app on actual iOS devices.

When I try to publish the app it builds and creates an ipa and a couple other artifacts in a folder.

I then try to distribute it to the Apple app store and get an error.

I tried using transporter to upload the IPA and it says the app is not signed.

So I did the dotnet publish -f net8.0-ios -c Release command on a command line in the folder of the project and get an error:

error : Code signing must be enabled to create an Xcode archive.

In Visual Studio I went to the project settings and have it set to auto. I also went through the manage accounts and made sure that was all set up and pointing to the right account. I also downloaded all profiles. I also saw the particular distribution profile in the list of profiles that should have been downloaded.

I am able to run this same command on my Mac in the same folder and it works...so same source code CLI on Mac works and signs properly, CLI on Windows has the signing error.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,962 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 35,916 Reputation points Microsoft Vendor
    2025-02-06T05:43:45.2033333+00:00

    Hello,

    I have connected the VM to my host Mac and am able to build and debug the app on actual iOS devices.

    From this, I know the Windows machine has paired to the Mac and it works on debug mode.

    I did the dotnet publish -f net8.0-ios -c Release command on a command line in the folder of the project and get an error:

    This dotnet publish -f net8.0-ios -c Release command is missing the codesign parameters.

    For example, you could use the following command:

    (Take care to find your own sign identity and provisioning profile)

    dotnet publish -f net8.0-ios -c Release -p:ArchiveOnBuild=true -p:CodesignKey="Apple Distribution:XXX" -p:CodesignProvision="MyMauiApp"
    

    For more details, please refer to Publish a .NET MAUI iOS app using the command line - .NET MAUI | Microsoft Learn

    Besides, there is another way to publish the app, you could archive the project with Visual Studio 2022 directly. See Publish a .NET MAUI iOS app for App Store distribution - .NET MAUI | Microsoft Learn

    Best Regards,

    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.