Unable to do Production Build for iOS on Visual Studio

K T 0 Reputation points
2025-03-06T18:19:50.9233333+00:00

Whenever we try to build, we get the following error.

The certificate 'Apple Distribution:… does not match … However the certificate exists on both the Windows Build Machine and the Mac Agent. This then results in the following error. C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net8.0_18.0\18.0.8319\tools\msbuild\iOS\Xamarin.Shared.targets(1835,3): error : iOS code signing key ‘Apple Distribution:…’ not found in keychain.

The certificates have already been deleted and re-installed with no success.

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

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 35,996 Reputation points Microsoft External Staff
    2025-03-07T03:43:45.5933333+00:00

    Hello,

    However the certificate exists on both the Windows Build Machine and the Mac Agent.

    First, please open Appledeveloper connect, find the provisioning profile you used. And then, view the detail to check which certificate is matched to the provisioning profile. After that, you can compare if the certificate in local is not same as the matched certificate.

    Also, if the certificate is matched, please check if it has been revoked or expired.

    If so, you could create a new distribution certificate and distribution provisioning profile, refer to 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.