Bug 29654 - "Project properties -> iOS Bundle Signing" shows "This page is valid only for hardware platforms" when targeting Simulator
Summary: "Project properties -> iOS Bundle Signing" shows "This page is valid only for...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.11 (C5)
Hardware: PC Mac OS
: --- normal
Target Milestone: 3.11.2 (C5SR2)
Assignee: Bugzilla
Depends on:
Reported: 2015-05-01 11:21 UTC by John Miller [MSFT]
Modified: 2015-06-23 13:27 UTC (History)
7 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description John Miller [MSFT] 2015-05-01 11:21:57 UTC

   After updating to 3.11, users are getting code signing errors when deploying to simulators. This appears to be to some changes in checks for custom Entitlements in the project properties. 

**Steps to Reproduce:**

   1. Create a new iOS Single View application in VS. 
   2. The iOS Bundle Signing -> Custom Entitlements box is not editable when targeting Simulators in VS, so to set this it has to be done in the .csproj or from Xamarin Studio on Mac. 
   Add the following to the Debug|iPhoneSimulator configuration in the .csproj

   <CodesignKey>iPhone Developer</CodesignKey>


   open the project in Xamarin Studio on the Mac and set the Custom Entitlements to the Entitlements.plist file. 

  3. Build and deploy to an iPhone Simulator on Mac. 

**Actual Results:**

   Build error "Error: No valid iOS code signing keys found in keychain."

**Expected Results:**

   No errors related to code signing.

**Build Date & Platform:**

   XVS 3.11

**Additional Information:**

   After speaking with Jeff, this is expected behavior. Setting Custom Entitlements requires a code signing certificate because Entitlements are merged in from provisioning profiles. There are checks in place now for this. The confusing part is that Visual Studio does not let you edit the Bundle Signing options / Custom Entitlements when targeting a simulator whereas Xamarin Studio does. If you work in Xamarin Studio and set this property for whatever reason, then open it in VS, you may hit this issue with no way to edit / remove the Entitlement setting in the Project Properties. 

I think the real issue is the inconsistent behavior in our Project Options/Properties window. On VS, it's not editable. In XS, it is. 

To work around this in Visual Studio, manually edit the .csproj and remove the following elements from any configurations targeting iPhoneSimulator

<CodesignKey>iPhone Developer</CodesignKey>
Comment 1 John Miller [MSFT] 2015-05-01 16:10:39 UTC
It seems that removing the following elements from the .csproj causes VS to not load the iOS project anymore. I guess that will not be a valid workaround. 

<CodesignKey>iPhone Developer</CodesignKey>
Comment 2 Jeffrey Stedfast 2015-05-01 16:13:02 UTC
The one that matters is CodesignEntitlements. You could just set it to:


i.e. no value.
Comment 3 Frane Crnjak 2015-05-04 15:01:00 UTC
tested and it works! thank you :)
Comment 5 Brendan Zagaeski (Xamarin Team, assistant) 2015-06-04 15:49:38 UTC
Many thanks for fix! I am updating the summary of the bug to more precisely match the fix that was applied.
Comment 6 Mohit Kheterpal 2015-06-23 13:27:46 UTC
This issue is verified in trello card : https://trello.com/c/ljAzCH8X/82-xvs-bug-29654-no-valid-ios-code-signing-keys-found-in-keychain-when-targeting-simulator

Hence closing this issue.