Can't use Entity Framework Core in iOS Release builds #12537
Labels
area-publishing
Issues with the app packaging/publishing process (ipk/apk/msix/trimming)
external
partner/macios
Issues for the Mac / iOS SDK
partner
Issue or Request from a partner team
platform/iOS 🍎
s/needs-info
Issue needs more info from the author
t/bug
Something isn't working
Description
When running a Release build of an iOS app with Entity Framework Core, the app crashes upon startup. Debug builds and Android builds (Debug and Release) work fine. It has something to do with AOT compilation which is required by Apple; somehow it trims away relevant parts of the library. See also this Stack Overflow question.
Steps to Reproduce
The easiest way to reproduce it on macOS is to use the .NET MAUI App template in Visual Studio, edit the project file and add some configuration to make sure you can use
dotnet build
(Release builds from Visual Studio for Mac don't work at the moment):Open the project folder in Terminal, and run
(be sure to specify the right project file, and the UDID of your iPhone). This works, but as soon as you add Entity Framework Core to the project:
the app starts to crash on startup.
Version with bug
7.0 (current)
Last version that worked well
Xamarin Forms 5
Affected platforms
iOS
Affected platform versions
iOS 16
Did you find any workaround?
No
Relevant log output
The text was updated successfully, but these errors were encountered: