EFCore in .Net 8 on iOS and NativeAOT #21909
danbrannanavontus
started this conversation in
Upgrading from Xamarin
Replies: 2 comments 1 reply
-
Quick update. Downgrading to EFCore 7 gives a similar but different error: 'Attempting to JIT compile method wrapper dynamic-method while running in aot-only mode' |
Beta Was this translation helpful? Give feedback.
1 reply
-
For anyone who finds this, I used the fix described in this report and it worked for me. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
We're porting an application from Xamarin/.Net4.x to Maui/.Net 8 and after months of wrestling with various iOS issues, the app now builds, installs and runs. However, upon performing any data access, via Microsoft.EntityFrameworkCore 8.0.3, we now get the following error: 'Model building is not supported when publishing with NativeAOT. Use a compiled model'. Turning off AOT using <PublishAot>false</PublishAot> doesn't seem to do anything.
From what I have read, NativeAOT is an experimental new feature in .Net 7/8, and that proper support for it in EFCore will come from .Net 9 onwards. I also read that AOT cannot be disabled in iOS which does seem to be true given disabling <PublishAot> doesn't fix it. So does this mean that EFCore simply doesn't work in .Net 8 on iOS? How did EF ever work in Xamarin if AOT can't be disabled?
I hope someone can point me in the right direction on this one.
Thanks!
Dan
Beta Was this translation helpful? Give feedback.
All reactions