wjvii
wjvii

Reputation: 71

Xamarin Forms and Entity Framework Core NetStandard

Recently Xamarin announced support for NetStandard (see https://releases.xamarin.com/stable-release-cycle-7-service-release-1/) and the recently shipped Entity Framework Core supports NetStandard. There was a recent issue with the SQLite.Native package that has been resolved (see https://github.com/aspnet/EntityFramework/issues/4269) but when I build the Android version of a Xamarin Forms application it appears it does not include all the assemblies in the output that are needed by the Entity Framework and therefore the application will not run and crashes on the first line of EF code to retrieve data. The UWP version appears to work just fine so this seems like an issue with Android (possibly iOS too).

Has anyone run into this and know a way around it so that the compiled Xamarin Forms Android application will run using Entity Framework Core to access a SQLite database?

Thank you in advance.

Upvotes: 5

Views: 1343

Answers (2)

Geniuslead
Geniuslead

Reputation: 99

need to use -linkskip to inform compiler not to remove references.

Upvotes: 0

Foyzul Karim
Foyzul Karim

Reputation: 4502

Here are the steps you can follow.

  • Create a Xamarin.Forms project.
  • Convert the PCL project's properties to .NET Standard 1.3 enter image description here
  • Install Entity Framework Core and other EF Core stuffs

I have prepared a small hello world project at Github Here.

Upvotes: 0

Related Questions