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.
Please sign in to leave a comment.
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.
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?
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.
I am currenlty facing this issue. What do you mean by download .NET via Rider?
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?
Have a nice day!
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.