Using entitlements.plist in iOS app

Hi,

I'm just switching over to using Rider from Visual Studio for Mac.  I need to use an entitlements.plist for key chain access but I can't see a way to include the entitlements.plist as part of the bundle (in Visual Studio you can select an entitlements file as part of the Bundle settings).

Any help would be appreciated.

0
7 comments

Hello Amccandlish ,

Thank you for reaching Rider Forum.

Entitlements.plist should be included in the project if it exists. Could you please clarify the issue you are facing? Any error on the build or further application procession? 

Thank you in advance.

0

Hi Anna,

Thanks for the response.  I'm using the entitlements to access SecureStorage and when the app tries to save I get the following exception:

System.Exception: Error adding record: MissingEntitlement
  at Microsoft.Maui.Storage.KeyChain.SetValueForKey(String value, String key, String service)
  at Microsoft.Maui.Storage.SecureStorageImplementation.SetAsync(String key, String value, SecAccessible accessible)
  at Microsoft.Maui.Storage.SecureStorageImplementation.PlatformSetAsync(String key, String data)
  at Microsoft.Maui.Storage.SecureStorageImplementation.SetAsync(String key, String value)
  at Microsoft.Maui.Storage.SecureStorage.SetAsync(String key, String value)
  at AwareManagerDirect.SettingsService.SaveSettings(SettingsBundle settings)

I can't see any other errors, the Entitlements.plist is in the root directory of the iOS project (same as Info.plist).  I assume Rider should pull in anything with *.plist?  

0

I have got this all working now.  I wonder if Visual Studio for Mac and Rider were somehow tripping over each other.  I think the most important thing I did was delete the ~/.dotnet directory and then download .NET via Rider and that fixed a lot of issues.

0

I am currenlty facing this issue. What do you mean by download .NET via Rider?

0

Hello Adlar,

Thank you for contacting Rider support.

Do you have just the same exception as Amccandlish? Would you mind elaborating on the issue and sharing additional details as described below?

  • Screenshot of the Settings | Build, Execution, Deployment | Toolset and Build settings page;
  • Screenshot that demonstrates the issue;
  • What steps led to the issue?
  • If there is exact error message, please share it;
  • Collect Rider logs Help | Collect Logs and Diagnostic Data;
  • Upload the generated archive to the Upload Service and let me know the Upload ID.
    • Add screenshots to the upload or attach it here if possible;

Have a nice day!

0

When I first started I noticed that Rider was referencing the wrong version of .NET (maybe something to do with my install of Visual Studio for Mac) so I deleted the ~/.dotnet folder and then in Rider installed .NET from Settings -> Environment.  I'm pretty sure that I deleted the .bin & .obj directories at the same time.  After that everything seemed to start working properly.  I hope that helps.

0
Additional note: dotnet used by Rider can be switched in "Settings | Build, Execution, Deployment | Toolset and Build". Adlar, you might want to try switching the .NET CLI executable path there so see if that helps.
0

Please sign in to leave a comment.