"Not In Keychain" Issue with Apple Distribution Certificate in Visual Studio, Xcode 16

Dan Taxbøl 25 Reputation points
2024-11-05T15:59:11.26+00:00

Hello everyone,

I'm having trouble getting my Apple Distribution certificate to show up as valid in Visual Studio 17.11.5 for a Xamarin project. In Xamarin Apple Accounts under Apple Distribution, the certificate appears as "Not In Keychain."

Here's my setup:

  • Mac: Running Xcode 16, where the certificate shows up without any issues under Settings > Accounts.
  • Keychain Access: Both the certificate and its private key are present.
  • .NET SDK: SDK 8.0.403
  • iOS Simulator: iOS 18.1
  • Visual Studio: 17.11.5

I've already tried several steps to troubleshoot:

  1. Deleted cache folders located at:
    • %LocalAppData%\Xamarin
      • %LocalAppData%\Microsoft\VisualStudio\17.x (replacing 17.x with the correct version)
        • %LocalAppData%\Temp\Xamarin
        1. Issued a certificate from the Apple Developer portal.
        2. Issued a certificate from Xcode.
        3. Attempted to issue a Distribution Certificate directly in Visual Studio (but it wasn’t possible).
        4. Reinstalled both the Mac and Xcode.
        5. Reinstalled Visual Studio.

I would really appreciate any guidance or additional suggestions on resolving this issue. Thank you so much in advance for your time and help!Hello everyone,

I'm having trouble getting my Apple Distribution certificate to show up as valid in Visual Studio 17.11.5 for a Xamarin project. In Xamarin Apple Accounts under Apple Distribution, the certificate appears as "Not In Keychain."

Here's my setup:

  • Mac: Running Xcode 16, where the certificate shows up without any issues under Settings > Accounts.
  • Keychain Access: Both the certificate and its private key are present.
  • .NET SDK: SDK 8.0.403
  • iOS Simulator: iOS 18.1
  • Visual Studio: 17.11.5

I've already tried several steps to troubleshoot:

  1. Deleted cache folders located at:
    • %LocalAppData%\Xamarin
      • %LocalAppData%\Microsoft\VisualStudio\17.x (replacing 17.x with the correct version)
        • %LocalAppData%\Temp\Xamarin
        1. Issued a certificate from the Apple Developer portal.
        2. Issued a certificate from Xcode.
        3. Attempted to issue a Distribution Certificate directly in Visual Studio (but it wasn’t possible).
        4. Reinstalled both the Mac and Xcode.
        5. Reinstalled Visual Studio.

I would really appreciate any guidance or additional suggestions on resolving this issue. Thank you so much in advance for your time and help!

Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,766 Reputation points Volunteer Moderator
    2024-11-05T16:51:14.8166667+00:00

    Maui 8 does not support Xcode 16, you must use Xcode 15. To get Xcode 16 support you must upgrade to Maui 9.

    https://learn.microsoft.com/en-us/dotnet/maui/whats-new/dotnet-9?view=net-maui-8.0


  2. Dan Taxbøl 25 Reputation points
    2024-11-07T12:53:50.67+00:00

    The solution to my initial problem was to export the certificate with the private key as a .p12 file and import it into Visual Studio.

    IMPORTANT: In Keychain Access, make sure to select the Default Keychains > "login" and then go to the "My Certificates" tab, rather than the default "All Items" view. This is where I got stuck (user error). Once you’re in the My Certificates tab, you can export the certificate as a .p12 file, which includes the private key needed for Visual Studio. After doing this, the certificate status showed as "Valid."

    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.