EF 3.1 is crashing on Windows 19H2 and 20H1, EF 2.6 works fine in UWP apps, there is no log or crash error.
Please attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate.
EFCore_TestUWP.zip
Thanks, attached is sample test project and source checked in to repo: https://github.com/anand-bit-sin/Test_EFCoreSqlite. Please note that this is just adding a class with reference to EFCore.sqlite nuget version 3.1.2, and built with .NET native chain enabled while building. The issue is on fresh installed Windows 19H2 and 20H1, not with updated ones from previous Windows builds. UWP app installs successfully, but does not launch, just the splash screen is visible for a moment. More detail: This test app works fine with 2.2.6 nuget version, but has same crash issue with latest 3.1.3 version on the above Windows versions (e.g. 2004 19041.208). Please note that removing native tool chain while building, the app works fine. So, the issue seems to be with code optimization through Native Tool chain enabled.
EF Core 3.1 does not work with .NET native chain enabled. And it's not connected to SQLite, it also happens with SqlServer. What I can say is that the problem is in UWP and its native compiler, they are totally broken. Even debugger does not works - I am getting breakpoint handled, but exception is null?!? In UI it has value, but in debugger I can't see it. UWP is just a useless toy. And obviously nobody in MS care about. I deeply regret that I event touched so bad platform. My first UWP project will be the last one. Back to WPF :-)
By the way, EnsureCreated method in SQLite's provider also doesn't work when .NET native chain is enabled.
@ajcvickers Do we have any workaround for this issue? Can we use runtime directives file default.rd.xml to skip native compilation only for the entityframework code if we would like to. This issue is still there even with latest 20H2 Windows as well in addition to 19H2, 20H1 fresh installed OS, not the ones upgraded from 19H1.
@anand-bit-sin I am not aware of any workarounds.
Most helpful comment
EFCore_TestUWP.zip
Thanks, attached is sample test project and source checked in to repo: https://github.com/anand-bit-sin/Test_EFCoreSqlite. Please note that this is just adding a class with reference to EFCore.sqlite nuget version 3.1.2, and built with .NET native chain enabled while building. The issue is on fresh installed Windows 19H2 and 20H1, not with updated ones from previous Windows builds. UWP app installs successfully, but does not launch, just the splash screen is visible for a moment. More detail: This test app works fine with 2.2.6 nuget version, but has same crash issue with latest 3.1.3 version on the above Windows versions (e.g. 2004 19041.208). Please note that removing native tool chain while building, the app works fine. So, the issue seems to be with code optimization through Native Tool chain enabled.