dotnet / efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
https://docs.microsoft.com/ef/
MIT License
13.75k stars 3.18k forks source link

MAUI preview 4 does not work with EF Core, any version #25080

Closed ponyspeed888 closed 2 years ago

ponyspeed888 commented 3 years ago

EF Core 3.1, 5.0, and 6.0 preview does not work with MAUI application preview 4. The root cause seems to be in Microsoft.Data.Sqlite. It caused a "Target Invokation Error" when a SQLite connection is opening. In the attached project, this line

        SqliteConnection con = new SqliteConnection();  // THIS LINE CAUSED A TARGET INVOKATION ERROR

At MainApplication.cs, line 34

Attached project google drive link :

https://drive.google.com/file/d/1BcCGk26ZIHNJaxGb6vqVupsfhGAcmc-V/view?usp=sharing

zleao commented 3 years ago

I'm having this issue as well. When I try to run my app in an Adnroid local device, I noticed 2 things:

I'm using:

bricelam commented 3 years ago

I'm not able to repro this on the latest bits. Both the emulator and my ancient API 26 device worked for me.