Is AOT not supported for LINQ query expressions? #29933
Unanswered
ashok-kuvaraja
asked this question in
General
Replies: 2 comments 8 replies
-
Are you using EF Core? |
Beta Was this translation helpful? Give feedback.
5 replies
-
I think there is probably some confusion here, as to what flavor of AOT you're using.
Which AOT are you using? Mono's AOT or NativeAOT? To track down this further, what is the crash? Do you have a stack trace? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have developed two custom packages: one for generating item sources with data operation support, and another for displaying items similar to a ListView. The items source generation package uses reflection and LINQ expressions to perform data operations.
The issue arises when I enable AOT (Ahead-of-Time) compilation and generate the .ipa file—the app crashes. However, it works perfectly in both Release and Debug modes on the iOS platform. On macOS, it crashes in Release mode but runs fine in Debug mode.
I generated the .ipa file using the following command:
dotnet publish -f net9.0-ios -c Release -p:BuildIpa=True -p:EnableCodeSigning=false
Upon investigation, I found documentation indicating that LINQ has limitations with AOT compilation. Specifically, it mentions that certain LINQ features are not supported under AOT.
Documentation Reference:
EF Core Native AOT and Precompiled Queries - Limitations
Can anyone confirm whether LINQ is currently unsupported with AOT, or if there are workarounds available?
Beta Was this translation helpful? Give feedback.
All reactions