Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an iOS project to the sample #2

Merged
merged 4 commits into from
Oct 30, 2017
Merged

Conversation

cwrea
Copy link
Contributor

@cwrea cwrea commented May 17, 2017

(Relates to the sample for your blog post at https://blog.xamarin.com/building-android-apps-with-entity-framework. Thanks for that!)

Now that Xamarin.iOS 10.10 addressed the NotImplementedException blocker bug (dotnet/efcore#7158), I updated your sample to include a new iOS project that runs the same EF Core code example from the Droid project.

Getting the iOS app to run the same EF Core code successfully in the iOS simulator was straightforward with the new bits. However, getting the iOS app to run that EF Core code on an a physical iOS device took a bit more work:

Xamarin's default build configurations targeting the iOS simulator do not perform the linking that is typical of a device build. When targeting a device, the Xamarin linker removes unreferenced SDK types and methods from generated code. However, EF Core's query parser refers to certain SDK types and methods only via reflection. (e.g. search the EF Core repo for instances of GetRuntimeMethod.)

The linker directives in the iOS project's LinkDescription.xml file ensure the iOS app can run successfully on a physical iOS device. (I included a reference to this file via project settings "Additional mtouch arguments", as Visual Studio 2017 on PC is lacking the LinkDescription "Build Action" that is available on Visual Studio for Mac / Xamarin Studio.)

@JonDouglas JonDouglas merged commit 1103e3d into JonDouglas:master Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants