-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query throws Exception with Xamarin iOS -> linking issue #10207
Comments
@rob2212 Would it be possible for you to post a code listing or project that reproduces what you are seeing? It looks like this is likely a Xamarin issue, but we would like to investigate before potentially filing an issue with them. |
I will prepare sample project for reproduction later on. |
@ajcvickers I've created a test project which you can use to reproduce the issue. I've inserted some warnings at the relevant places. Where can I upload it? Attachments here can only be 10 MB. |
@rob2212 Two things to try:
|
Any news on this? Thanks! |
I have the same issue with the extension ToListAsync(). |
After updating to 2.0.1 and call .Any(), I get: The type initializer for 'Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions' threw an exception |
I have the same issue, is there any solution? |
I found an workaround (as it was blocking me to release the app), inspired by @rob2212 - use linkskip.
I don't know if all are needed, but I started with EFCore dependencies and added them until it started to work. FYI - @NPadrutt, @ajcvickers, @divega |
@eusebiu nice, so far it seems to work! thank you very much! :) |
Any news on this? Thanks! |
I did not encounter this problem in the iPhone X simulator, but encountered in my real iPhone X machine, which was very interesting. |
This issue was moved to xamarin/xamarin-macios#3394 |
Reopening to decide in triage whether we want to keep this for tracking purposes. |
When I query a DbSet e.g. with a simple ToList() call I get the exception shown below. The exception is only thrown on real iOS device. It works with the iOS emulator.
var test = context.Images.ToList();
The problem seems to be the linking behavior with the Xamarin project. I've tried to disable linking for some assemblies in the iOS Xamarin projefct under iOS Build:
--linkskip=Microsoft.EntityFrameworkCore --linkskip=Microsoft.EntityFrameworkCore.Relational --linkskip=Microsoft.EntityFrameworkCore.Sqlite --linkskip=Remotion.Linq
That didn't work. However disable linking completely does work (set Link Behavior to 'Don't Link'). But this can only be a temporary workaround not a final solution for production deployment.
Further technical details
EF Core version: v2.0.0
Database Provider: Microsoft.EntityFrameworkCore.Sqlite
Operating system: Windows 10 / iOS 11.1
IDE: Visual Studio 2017 (15.4.1)
The text was updated successfully, but these errors were encountered: